hist
hist copied to clipboard
[FEATURE] Histogram method that maps an array of points to array of "weights"/contents
Given an array
of dimension (nrows, ndim)
and given a histogram of dimension ndim
, looking for a method that can return an array "weights"
of dimension (nrows, 1)
that has bin content for each point in my array
(so not actually a weight per see).
Looking for something like (pseudo-code):
weights = hist.get_bin_content(array)
where the function get_bin_content
internally figures out the bin number for a given ndim
point (perhaps with np.digitize
) and returns the bin content for that point.
Is there something like this already? (Sorry if I have missed it).