Skip to content

Commit 57a33f4

Browse files
authored
Merge pull request #459 from MLecardonnel/feature/fix_numpy
Fix only shapash numy deprecation.
2 parents ab81f8c + efd121e commit 57a33f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shapash/utils/check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ def check_y(x=None, y=None, y_name="y_target"):
135135
if isinstance(y, pd.DataFrame):
136136
if y.shape[1] > 1:
137137
raise ValueError(f"{y_name} must be a one column pd.Dataframe or pd.Series.")
138-
if not (y.dtypes[0] in [np.float, np.int, np.int32, np.float32, np.int64, np.float64]):
138+
if not (y.dtypes[0] in [float, int, np.int32, np.float32, np.int64, np.float64]):
139139
raise ValueError(f"{y_name} must contain int or float only")
140140
if isinstance(y, pd.Series):
141-
if not (y.dtype in [np.float, np.int, np.int32, np.float32, np.int64, np.float64]):
141+
if not (y.dtype in [float, int, np.int32, np.float32, np.int64, np.float64]):
142142
raise ValueError(f"{y_name} must contain int or float only")
143143
y = y.to_frame()
144-
if isinstance(y.columns[0], (np.int, np.float)):
144+
if isinstance(y.columns[0], (int, float)):
145145
y.columns = [y_name]
146146
return y
147147

0 commit comments

Comments
 (0)