From 44fe0c1000934f2536a8792b96f0cf55df8108c9 Mon Sep 17 00:00:00 2001 From: shyanilMishra Date: Sun, 20 Apr 2025 22:41:16 +0530 Subject: [PATCH] BUG: Fix AttributeError when calling .max() on ArrowExtensionArray by using np.max() --- pandas/core/indexing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 34a437ba40bd8..424bfd84dd28d 100644 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -1610,7 +1610,7 @@ def _validate_key(self, key, axis: AxisInt) -> None: raise IndexError(f".iloc requires numeric indexers, got {arr}") # check that the key does not exceed the maximum size of the index - if len(arr) and (arr.max() >= len_axis or arr.min() < -len_axis): + if np.max(arr) >= len_axis or np.min(arr) < -len_axis: raise IndexError("positional indexers are out-of-bounds") else: raise ValueError(f"Can only index by location with a [{self._valid_types}]")