Skip to content

Commit 11e2b03

Browse files
authored
Merge branch 'pandas-dev:main' into main
2 parents 0e70f58 + 236d89b commit 11e2b03

File tree

6 files changed

+352
-358
lines changed

6 files changed

+352
-358
lines changed

pandas/core/algorithms.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
ABCExtensionArray,
6969
ABCIndex,
7070
ABCMultiIndex,
71+
ABCNumpyExtensionArray,
7172
ABCSeries,
7273
ABCTimedeltaArray,
7374
)
@@ -1161,11 +1162,14 @@ def take(
11611162
... )
11621163
array([ 10, 10, -10])
11631164
"""
1164-
if not isinstance(arr, (np.ndarray, ABCExtensionArray, ABCIndex, ABCSeries)):
1165+
if not isinstance(
1166+
arr,
1167+
(np.ndarray, ABCExtensionArray, ABCIndex, ABCSeries, ABCNumpyExtensionArray),
1168+
):
11651169
# GH#52981
11661170
raise TypeError(
1167-
"pd.api.extensions.take requires a numpy.ndarray, "
1168-
f"ExtensionArray, Index, or Series, got {type(arr).__name__}."
1171+
"pd.api.extensions.take requires a numpy.ndarray, ExtensionArray, "
1172+
f"Index, Series, or NumpyExtensionArray got {type(arr).__name__}."
11691173
)
11701174

11711175
indices = ensure_platform_int(indices)

0 commit comments

Comments
 (0)