hic3defdr.util.binning module

hic3defdr.util.binning.equal_bin(data, n_bins)[source]

Bins data into n_bins bins, with an equal number of points in each bin.

https://stackoverflow.com/a/40895507

Parameters:
  • data (np.ndarray) – The data to bin.
  • n_bins (int) – The number of bins to bin into.
Returns:

A vector of integers representing the bin index for each entry in data.

Return type:

np.ndarray