Skip to content

Commit 82a1421

Browse files
HabibiHyemattip
andauthored
Update numpy/_core/fromnumeric.py
Co-authored-by: Matti Picus <[email protected]>
1 parent 8992208 commit 82a1421

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

numpy/_core/fromnumeric.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,9 +1542,10 @@ def searchsorted(a, v, side='left', sorter=None):
15421542
>>> sorter = np.argsort(a)
15431543
>>> sorter
15441544
array([1, 2, 3, 0]) # Indices that would sort the array 'a'
1545-
>>> np.searchsorted(a, 25, sorter=sorter)
1545+
>>> result = np.searchsorted(a, 25, sorter=sorter)
1546+
>>> result
15461547
2
1547-
>>> a[sorter[np.searchsorted(a, 25, sorter=sorter)]]
1548+
>>> a[sorter[result]]
15481549
30 # The element at index 2 of the sorted array is 30.
15491550
"""
15501551
return _wrapfunc(a, 'searchsorted', v, side=side, sorter=sorter)

0 commit comments

Comments
 (0)