Skip to content

Commit 857c110

Browse files
author
ShaharNaveh
committed
Switching from np.ndarray to np.array
As pointed here: #40903 (comment)
1 parent 8274005 commit 857c110

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pandas/core/indexers.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -209,21 +209,24 @@ def validate_indices(indices: np.ndarray, n: int) -> None:
209209
210210
Examples
211211
--------
212-
>>> validate_indices(np.ndarray([1, 2]), 3) # OK
212+
>>> validate_indices(np.array([1, 2]), 3) # OK
213213
214-
>>> validate_indices(np.ndarray([1, -2]), 3)
214+
>>> validate_indices(np.array([1, -2]), 3)
215215
Traceback (most recent call last):
216216
...
217217
ValueError: negative dimensions are not allowed
218218
219-
>>> validate_indices(np.ndarray([1, 2, 3]), 3) # OK
220-
221-
>>> validate_indices(np.ndarray([-1, -1]), 0)
219+
>>> validate_indices(np.array([1, 2, 3]), 3)
222220
Traceback (most recent call last):
223221
...
224-
ValueError: negative dimensions are not allowed
222+
IndexError: indices are out-of-bounds
223+
224+
>>> validate_indices(np.array([-1, -1]), 0) # OK
225225
226-
>>> validate_indices(np.ndarray([0, 1]), 0) # OK
226+
>>> validate_indices(np.array([0, 1]), 0)
227+
Traceback (most recent call last):
228+
...
229+
IndexError: indices are out-of-bounds
227230
"""
228231
if len(indices):
229232
min_idx = indices.min()

0 commit comments

Comments
 (0)