Like `searchsorted`, but where the last item in `v` is placed on the right. In the context of a histogram, this makes the last bin edge inclusive
(a, v)
| 452 | |
| 453 | |
| 454 | def _search_sorted_inclusive(a, v): |
| 455 | """ |
| 456 | Like `searchsorted`, but where the last item in `v` is placed on the right. |
| 457 | |
| 458 | In the context of a histogram, this makes the last bin edge inclusive |
| 459 | """ |
| 460 | return np.concatenate(( |
| 461 | a.searchsorted(v[:-1], 'left'), |
| 462 | a.searchsorted(v[-1:], 'right') |
| 463 | )) |
| 464 | |
| 465 | |
| 466 | def _histogram_bin_edges_dispatcher(a, bins=None, range=None, weights=None): |