Skip to content

Commit

Permalink
Fix deprecations with pandas 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sebp committed Feb 1, 2024
1 parent 93a1e2a commit 0c1e1e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sksurv/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def transform(column):
except ValueError:
classes = column.dropna().unique()
classes.sort(kind="mergesort")
nc = column.replace(classes, np.arange(classes.shape[0], dtype=np.int64))
nc = column.map(dict(zip(classes, range(classes.shape[0]))))
return nc
if column.dtype == bool:
return column.astype(np.int64)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def non_numeric_data(self):
}
)

data.loc[:, "q3"] = data.loc[:, "q3"].astype("category")
data["q3"] = data.loc[:, "q3"].astype("category")
return data

def data_numeric(self):
Expand Down

0 comments on commit 0c1e1e0

Please sign in to comment.