histogram#
- scikitplot.cexternals._astropy.stats.histogram(a, bins=10, range=None, weights=None, **kwargs)[source]#
Enhanced histogram function, providing adaptive binnings.
This is a histogram function that enables the use of more sophisticated algorithms for determining bins. Aside from the
binsargument allowing a string specified how bins are computed, the parameters are the same asnumpy.histogram.- Parameters:
- aarray-like
array of data to be histogrammed
- binsint, list, or str, optional
If bins is a string, then it must be one of:
‘blocks’ : use bayesian blocks for dynamic bin widths
‘knuth’ : use Knuth’s rule to determine bins
‘scott’ : use Scott’s rule to determine bins
‘freedman’ : use the Freedman-Diaconis rule to determine bins
- rangetuple or None, optional
the minimum and maximum range for the histogram. If not specified, it will be (x.min(), x.max())
- weightsarray-like, optional
An array the same shape as
a. If given, the histogram accumulates the value of the weight corresponding toainstead of returning the count of values. This argument does not affect determination of bin edges.- **kwargsdict, optional
Extra arguments are described in
numpy.histogram.
- Returns:
- histarray
The values of the histogram. See
densityandweightsfor a description of the possible semantics.- bin_edgesarray of dtype float
Return the bin edges
(length(hist)+1).
- Parameters:
a (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
bins (int | list[float] | Literal['blocks', 'knuth', 'scott', 'freedman'] | None)
weights (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None)
- Return type:
tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]]
See also