File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change 55import numpy as np
66import pandas ._libs .tslib as tslib
77from pandas import compat
8- from pandas .core .algorithms import take_1d
9- from . common import ( is_categorical_dtype ,
10- is_sparse ,
11- is_datetimetz ,
12- is_datetime64_dtype ,
13- is_timedelta64_dtype ,
14- is_period_dtype ,
15- is_object_dtype ,
16- is_bool_dtype ,
17- is_dtype_equal ,
18- _NS_DTYPE ,
19- _TD_DTYPE )
8+ from pandas .core .typed . common import (
9+ is_categorical_dtype ,
10+ is_sparse ,
11+ is_datetimetz ,
12+ is_datetime64_dtype ,
13+ is_timedelta64_dtype ,
14+ is_period_dtype ,
15+ is_object_dtype ,
16+ is_bool_dtype ,
17+ is_dtype_equal ,
18+ _NS_DTYPE ,
19+ _TD_DTYPE )
2020from pandas .core .typed .generic import (
2121 ABCDatetimeIndex , ABCTimedeltaIndex ,
2222 ABCPeriodIndex )
@@ -277,6 +277,8 @@ def _maybe_unwrap(x):
277277 if sort_categories and not categories .is_monotonic_increasing :
278278 categories = categories .sort_values ()
279279 indexer = categories .get_indexer (first .categories )
280+
281+ from pandas .core .algorithms import take_1d
280282 new_codes = take_1d (indexer , new_codes , fill_value = - 1 )
281283 elif ignore_order or all (not c .ordered for c in to_union ):
282284 # different categories - union and recode
@@ -289,6 +291,8 @@ def _maybe_unwrap(x):
289291 for c in to_union :
290292 if len (c .categories ) > 0 :
291293 indexer = categories .get_indexer (c .categories )
294+
295+ from pandas .core .algorithms import take_1d
292296 new_codes .append (take_1d (indexer , c .codes , fill_value = - 1 ))
293297 else :
294298 # must be all NaN
You can’t perform that action at this time.
0 commit comments