Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 42b4e7c

Browse files
committedFeb 2, 2019
Guard against IntegerArray + cleanups
1 parent c8bc02c commit 42b4e7c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed
 

‎pandas/core/algorithms.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1724,9 +1724,9 @@ def func(arr, indexer, out, fill_value=np.nan):
17241724
return out
17251725

17261726

1727-
# ---- #
1727+
# ------------ #
17281728
# searchsorted #
1729-
# ---- #
1729+
# ------------ #
17301730

17311731
def searchsorted(arr, value, side="left", sorter=None):
17321732
"""
@@ -1774,7 +1774,7 @@ def searchsorted(arr, value, side="left", sorter=None):
17741774
if sorter is not None:
17751775
sorter = ensure_platform_int(sorter)
17761776

1777-
if is_integer_dtype(arr) and (
1777+
if isinstance(arr, np.ndarray) and is_integer_dtype(arr) and (
17781778
is_integer(value) or is_integer_dtype(value)):
17791779
from .arrays.array_ import array
17801780
# if `arr` and `value` have different dtypes, `arr` would be

‎pandas/core/common.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import numpy as np
1313

1414
from pandas._libs import lib, tslibs
15+
import pandas.compat as compat
1516
from pandas.compat import PY36, OrderedDict, iteritems
1617

1718
from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
@@ -21,8 +22,6 @@
2122
from pandas.core.dtypes.inference import _iterable_not_string
2223
from pandas.core.dtypes.missing import isna, isnull, notnull # noqa
2324

24-
from pandas import compat
25-
2625

2726
class SettingWithCopyError(ValueError):
2827
pass

0 commit comments

Comments
 (0)
Please sign in to comment.