|
8 | 8 |
|
9 | 9 | import numpy as np
|
10 | 10 |
|
| 11 | +<<<<<<< HEAD |
11 | 12 | from pandas._libs import hashtable as libhashtable, join as libjoin, lib
|
12 | 13 | import pandas.compat as compat
|
13 | 14 | from pandas.compat import filter, lzip, map, range, zip
|
14 | 15 | from pandas.errors import MergeError
|
| 16 | +======= |
| 17 | +from pandas import (Categorical, DataFrame, |
| 18 | + Index, MultiIndex, Timedelta, Series) |
| 19 | +from pandas.core.arrays.categorical import _recode_for_categories |
| 20 | +from pandas.core.frame import _merge_doc |
| 21 | +from pandas.core.dtypes.common import ( |
| 22 | + is_datetime64tz_dtype, |
| 23 | + is_datetime64_dtype, |
| 24 | + needs_i8_conversion, |
| 25 | + is_int64_dtype, |
| 26 | + is_array_like, |
| 27 | + is_categorical_dtype, |
| 28 | + is_integer_dtype, |
| 29 | + is_float_dtype, |
| 30 | + is_number, |
| 31 | + is_numeric_dtype, |
| 32 | + is_integer, |
| 33 | + is_extension_array_dtype, |
| 34 | + is_int_or_datetime_dtype, |
| 35 | + is_dtype_equal, |
| 36 | + is_bool, |
| 37 | + is_bool_dtype, |
| 38 | + is_list_like, |
| 39 | + is_datetimelike, |
| 40 | + ensure_int64, |
| 41 | + ensure_float64, |
| 42 | + ensure_object, |
| 43 | + _get_dtype) |
| 44 | +from pandas.core.dtypes.missing import na_value_for_dtype |
| 45 | +from pandas.core.internals import (items_overlap_with_suffix, |
| 46 | + concatenate_block_managers) |
| 47 | +>>>>>>> fix bug #GH23020 |
15 | 48 | from pandas.util._decorators import Appender, Substitution
|
16 | 49 |
|
17 | 50 | from pandas.core.dtypes.common import (
|
@@ -1518,6 +1551,10 @@ def _factorize_keys(lk, rk, sort=True):
|
1518 | 1551 |
|
1519 | 1552 | lk = ensure_int64(lk.codes)
|
1520 | 1553 | rk = ensure_int64(rk)
|
| 1554 | + elif is_extension_array_dtype(lk) and is_extension_array_dtype(rk): |
| 1555 | + klass = libhashtable.Factorizer |
| 1556 | + lk = ensure_object(lk) |
| 1557 | + rk = ensure_object(rk) |
1521 | 1558 | elif is_int_or_datetime_dtype(lk) and is_int_or_datetime_dtype(rk):
|
1522 | 1559 | klass = libhashtable.Int64Factorizer
|
1523 | 1560 | lk = ensure_int64(com.values_from_object(lk))
|
|
0 commit comments