@@ -71,7 +71,7 @@ def _is_numeric(data):
7171 array = _to_numpy_array (data )
7272 return len (data ) and (
7373 np .issubdtype (array .dtype , np .number )
74- or np .issubdtype (array .dtype , np . object )
74+ or np .issubdtype (array .dtype , object )
7575 and all (isinstance (_ , np .number ) for _ in array .flat )
7676 )
7777
@@ -82,9 +82,9 @@ def _is_categorical(data):
8282 """
8383 array = _to_numpy_array (data )
8484 return len (data ) and (
85- np .issubdtype (array .dtype , np . str )
86- or np .issubdtype (array .dtype , np . object )
87- and any (isinstance (_ , np . str ) for _ in array .flat )
85+ np .issubdtype (array .dtype , str )
86+ or np .issubdtype (array .dtype , object )
87+ and any (isinstance (_ , str ) for _ in array .flat )
8888 )
8989
9090
@@ -161,7 +161,7 @@ def _to_masked_array(data, *, copy=False):
161161 else :
162162 data = ma .masked_invalid (data , copy = copy )
163163 if np .issubdtype (data .dtype , np .integer ):
164- data = data .astype (np .float )
164+ data = data .astype (np .float64 )
165165 if np .issubdtype (data .dtype , np .number ):
166166 data .fill_value *= np .nan # default float fill_value is 1e+20 or 1e+20 + 0j
167167 else :
@@ -508,7 +508,7 @@ def _safe_range(data, lo=0, hi=100):
508508 if data .size :
509509 min_ = np .min (data ) if lo <= 0 else np .percentile (data , lo )
510510 if hasattr (min_ , 'dtype' ) and np .issubdtype (min_ .dtype , np .integer ):
511- min_ = np .float (min_ )
511+ min_ = np .float64 (min_ )
512512 try :
513513 is_finite = np .isfinite (min_ )
514514 except TypeError :
@@ -520,7 +520,7 @@ def _safe_range(data, lo=0, hi=100):
520520 if data .size :
521521 max_ = np .max (data ) if hi >= 100 else np .percentile (data , hi )
522522 if hasattr (max_ , 'dtype' ) and np .issubdtype (max_ .dtype , np .integer ):
523- max_ = np .float (max_ )
523+ max_ = np .float64 (max_ )
524524 try :
525525 is_finite = np .isfinite (min_ )
526526 except TypeError :
0 commit comments