Skip to content

Commit

Permalink
Remove FutureWarning: Setting an item of incompatible dtype is deprec…
Browse files Browse the repository at this point in the history
…ated (#374)
  • Loading branch information
fealho authored Apr 30, 2024
1 parent 825a643 commit 7bf46c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ctgan/data_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def transform(self, raw_data):

def _inverse_transform_continuous(self, column_transform_info, column_data, sigmas, st):
gm = column_transform_info.transform
data = pd.DataFrame(column_data[:, :2], columns=list(gm.get_output_sdtypes()))
data = pd.DataFrame(
column_data[:, :2], columns=list(gm.get_output_sdtypes())).astype(float)
data[data.columns[1]] = np.argmax(column_data[:, 1:], axis=1)
if sigmas is not None:
selected_normalized_value = np.random.normal(data.iloc[:, 0], sigmas[st])
Expand Down

0 comments on commit 7bf46c0

Please sign in to comment.