Skip to content

Commit 44fe0c1

Browse files
author
shyanilMishra
committed
BUG: Fix AttributeError when calling .max() on ArrowExtensionArray by using np.max()
1 parent a811388 commit 44fe0c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ def _validate_key(self, key, axis: AxisInt) -> None:
16101610
raise IndexError(f".iloc requires numeric indexers, got {arr}")
16111611

16121612
# check that the key does not exceed the maximum size of the index
1613-
if len(arr) and (arr.max() >= len_axis or arr.min() < -len_axis):
1613+
if np.max(arr) >= len_axis or np.min(arr) < -len_axis:
16141614
raise IndexError("positional indexers are out-of-bounds")
16151615
else:
16161616
raise ValueError(f"Can only index by location with a [{self._valid_types}]")

0 commit comments

Comments
 (0)