Histogram.from_data (method)
def from_data(cls, data, bins=10, range=None, weights=None, label=None, label_latex=None, unit=None, wrap_at=None)
Create a Histogram distribution from data. Note that under-the-hood a linear interpolator is used between the bins for the pdf, cdf, and ppf functions (and for sampling).
This can also be created from a function at the top-level as:
See also:
Arguments
data
(np.array object): 1D array of values.bins
(int or array, optional, default=10): number of bins or value of bin edges. Passed to np.histogram.range
(tuple, optional, default=None): passed to np.histogram.weights
(array, optional, default=None): passed to np.histogram.unit
(astropy.units object, optional): the units of the provided values.label
(string, optional): a label for the distribution. This is used for the x-label while plotting the distribution iflabel_latex
is not provided, as well as a shorthand notation when creating a Composite distribution.label_latex
(string, optional): a latex label for the distribution. This is used for the x-label while plotting.wrap_at
(float, None, or False, optional, default=None): value to use for wrapping. If None andunit
are angles, will default to 2*pi (or 360 degrees). If None andunit
are cycles, will default to 1.0.
Returns
- a Histogram object