adbin_hist1d

hep_spt.adbin_hist1d(arr, nbins=100, range=None, weights=None, is_sorted=False, reduce_bias=False, **kwargs)[source]

Create an adaptive binned histogram in one dimension.

Parameters
  • arr (numpy.ndarray) – array of data.

  • nbins (int) – number of bins. Must be greater than the length of the input array.

  • range (None or tuple(float, float)) – range of the histogram.

  • weights (numpy.ndarray) – optional array of weights.

  • is_sorted (bool) – whether the input sample is already sorted or not.

  • reduce_bias (bool) – if set to True, the array will be processed twice (backward and forward) to reduce any kind of bias produced. See adbin_hist1d_edges() for more details.

  • kwargs (dict) – any other argument to be passed to plotting.errorbar_hist().

Returns

Values, edges, the distance between the center and the bounds of the bins in X and Y errors. The shape of the errors in Y depends on the uncertainty type passed to errorbar_hist() in “kwargs”.

Return type

numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray