Skip to content

Commit ef7db49

Browse files
committed
remove circular import
1 parent 6cc8523 commit ef7db49

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

pandas/core/typed/concat.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
import numpy as np
66
import pandas._libs.tslib as tslib
77
from 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)
2020
from 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

0 commit comments

Comments
 (0)