Skip to content

Commit a9c49ea

Browse files
committed
update comments
1 parent d3039ad commit a9c49ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/indexing.py

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

16121612
if len(arr):
1613-
# handle ExtensionArray safely using _reduce method else use numpy
1613+
# handle ExtensionArray using _reduce method else use numpy
16141614
if isinstance(arr.dtype, ExtensionDtype):
16151615
arr_max = arr._reduce("max")
16161616
arr_min = arr._reduce("min")
16171617
else:
16181618
arr_max = np.max(arr)
16191619
arr_min = np.min(arr)
16201620

1621+
# check that the key does not exceed the maximum size
16211622
if arr_max >= len_axis or arr_min < -len_axis:
16221623
raise IndexError("positional indexers are out-of-bounds")
16231624
else:

0 commit comments

Comments
 (0)