@@ -380,12 +380,12 @@ def __init__(self, values, categories=None, ordered=None, dtype=None,
380
380
dtype = CategoricalDtype (values .categories , dtype .ordered )
381
381
382
382
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
384
384
# of numpy
385
385
values = maybe_infer_to_datetimelike (values , convert_dates = True )
386
386
if not isinstance (values , np .ndarray ):
387
387
values = _convert_to_list_like (values )
388
- from pandas .core .series import _sanitize_array
388
+ from pandas .core .internals . construction import sanitize_array
389
389
# By convention, empty lists result in object dtype:
390
390
if len (values ) == 0 :
391
391
sanitize_dtype = 'object'
@@ -394,7 +394,7 @@ def __init__(self, values, categories=None, ordered=None, dtype=None,
394
394
null_mask = isna (values )
395
395
if null_mask .any ():
396
396
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 )
398
398
399
399
if dtype .categories is None :
400
400
try :
@@ -2442,12 +2442,12 @@ def isin(self, values):
2442
2442
>>> s.isin(['lama'])
2443
2443
array([ True, False, True, False, True, False])
2444
2444
"""
2445
- from pandas .core .series import _sanitize_array
2445
+ from pandas .core .internals . construction import sanitize_array
2446
2446
if not is_list_like (values ):
2447
2447
raise TypeError ("only list-like objects are allowed to be passed"
2448
2448
" to isin(), you passed a [{values_type}]"
2449
2449
.format (values_type = type (values ).__name__ ))
2450
- values = _sanitize_array (values , None , None )
2450
+ values = sanitize_array (values , None , None )
2451
2451
null_mask = np .asarray (isna (values ))
2452
2452
code_values = self .categories .get_indexer (values )
2453
2453
code_values = code_values [null_mask | (code_values >= 0 )]
0 commit comments