You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation about the returned indices from np.searchsorted could be improved by clarifying that the returned indices refer to the sorter array and not the original (unsorted) array.
Now that I have manually confirmed that the indices do refer to sorter, I can also see that the searchsorted documentation contains this line - Find the indices into a sorted array a such that - but I failed to make that connection despite reading the documentation multiple times.
By adding something like "when sorter is present, then the returned indices refer to the sorter array (i.e., a[sorter[indices]] == v" (or equivalently, an example that shows the use of sorter and how the returned indices match the queried values). Even a pretend test code like the following would demonstrate the semantics for the return value for np.searchsorted when used with sorter.
Issue with current documentation:
The documentation about the returned indices from
np.searchsorted
could be improved by clarifying that the returned indices refer to thesorter
array and not the original (unsorted) array.Now that I have manually confirmed that the indices do refer to
sorter
, I can also see that thesearchsorted
documentation contains this line - Find the indices into a sorted array a such that - but I failed to make that connection despite reading the documentation multiple times.By adding something like "when
sorter
is present, then the returned indices refer to the sorter array (i.e.,a[sorter[indices]] == v
" (or equivalently, an example that shows the use ofsorter
and how the returned indices match the queried values). Even a pretend test code like the following would demonstrate the semantics for the return value fornp.searchsorted
when used withsorter
.(FIrst time opening an issue - apologies in advance if I am not correctly following some process)
Idea or request for content:
No response
The text was updated successfully, but these errors were encountered: