@@ -380,12 +380,12 @@ def __init__(self, values, categories=None, ordered=None, dtype=None,
380380 dtype = CategoricalDtype (values .categories , dtype .ordered )
381381
382382 elif not isinstance (values , (ABCIndexClass , ABCSeries )):
383- # _sanitize_array coerces np.nan to a string under certain versions
383+ # sanitize_array coerces np.nan to a string under certain versions
384384 # of numpy
385385 values = maybe_infer_to_datetimelike (values , convert_dates = True )
386386 if not isinstance (values , np .ndarray ):
387387 values = _convert_to_list_like (values )
388- from pandas .core .series import _sanitize_array
388+ from pandas .core .internals . construction import sanitize_array
389389 # By convention, empty lists result in object dtype:
390390 if len (values ) == 0 :
391391 sanitize_dtype = 'object'
@@ -394,7 +394,7 @@ def __init__(self, values, categories=None, ordered=None, dtype=None,
394394 null_mask = isna (values )
395395 if null_mask .any ():
396396 values = [values [idx ] for idx in np .where (~ null_mask )[0 ]]
397- values = _sanitize_array (values , None , dtype = sanitize_dtype )
397+ values = sanitize_array (values , None , dtype = sanitize_dtype )
398398
399399 if dtype .categories is None :
400400 try :
@@ -2442,12 +2442,12 @@ def isin(self, values):
24422442 >>> s.isin(['lama'])
24432443 array([ True, False, True, False, True, False])
24442444 """
2445- from pandas .core .series import _sanitize_array
2445+ from pandas .core .internals . construction import sanitize_array
24462446 if not is_list_like (values ):
24472447 raise TypeError ("only list-like objects are allowed to be passed"
24482448 " to isin(), you passed a [{values_type}]"
24492449 .format (values_type = type (values ).__name__ ))
2450- values = _sanitize_array (values , None , None )
2450+ values = sanitize_array (values , None , None )
24512451 null_mask = np .asarray (isna (values ))
24522452 code_values = self .categories .get_indexer (values )
24532453 code_values = code_values [null_mask | (code_values >= 0 )]
0 commit comments