Commit bec6188
committed
Clip searchsorted result to valid range
When np.searchsorted doesn't find an index, it returns N, where N is the
length of the array being searched. This causes indexing errors.
The `valid` mask ensures we're not using invalid values where pos >=
len(keys), however, since pos is still used in other indexing
operations, we clip to avoid oob indexing errors1 parent fb62f43 commit bec6188
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
343 | 347 | | |
344 | 348 | | |
345 | 349 | | |
| |||
0 commit comments