scipy.stats.histogram(a, numbins=10, defaultlimits=None, weights=None, printextras=False)

Separates the range into several bins and returns the number of instances of a in each bin. This histogram is based on numpy’s histogram but has a larger range by default if default limits is not set.

Parameters :

a: array like :

Array of scores which will be put into bins.

numbins: integer, optional :

The number of bins to use for the histogram. Default is 10.

defaultlimits: tuple (lower, upper), optional :

The lower and upper values for the range of the histogram. If no value is given, a range slightly larger then the range of the values in a is used. Specifically (a.min() - s, a.max() + s),

where s is (1/2)(a.max() - a.min()) / (numbins - 1)

weights: array like, same length as a, optional :

The weights for each value in a. Default is None, which gives each value a weight of 1.0

printextras: boolean, optional :

If True, the number of extra points is printed to standard output. Default is False

Returns :

histogram: array :

Number of points (or sum of weights) in each bin

low_range: float :

Lowest value of histogram, the lower limit of the first bin.

binsize: float :

The size of the bins (all bins have the same size).

extrapoints: integer :

The number of points outside the range of the histogram

See also


Previous topic


Next topic


This Page