MCPcopy Create free account
hub / github.com/numpy/numpy / _search_sorted_inclusive

Function _search_sorted_inclusive

numpy/lib/histograms.py:454–463  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

452
453
454def _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
466def _histogram_bin_edges_dispatcher(a, bins=None, range=None, weights=None):

Callers 1

histogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected