Returns a relative frequency histogram, using the histogram function.
Parameters : | a : array_like
numbins: int, optional :
defaultlimits: tuple (lower, upper), optional :
weights: array_like, optional :
|
---|---|
Returns : | relfreq : ndarray
lowerreallimit : float
binsize : float
extrapoints : int
|
Examples
>>> a = np.array([1, 4, 2, 1, 3, 1])
>>> relfreqs, lowlim, binsize, extrapoints = sp.stats.relfreq(a, numbins=4)
>>> relfreqs
array([ 0.5 , 0.16666667, 0.16666667, 0.16666667])
>>> np.sum(relfreqs) # relative frequencies should add up to 1
0.99999999999999989