sciPy stats.relfreq() function | Python Last Updated : 13 Feb, 2019 Comments Improve Suggest changes Like Article Like Report scipy.stats.relfreq(a, numbins, defaultreallimits, weights) is a relative frequency histogram, using the histogram function. Parameters : arr : [array_like] input array. numbins : Number of bins to use for the histogram. [Default = 10] defaultreallimits : (lower, upper) range of the histogram. weights : [array_like] weights for each array element. Results : - relative frequency binned values - width of each bin - lower real limit - extra points. Code #1: Python3 1== # relative frequency from scipy import stats import numpy as np arr1 = [1, 3, 27, 2, 5, 13] print ("Array element : ", arr1, "\n") a, b, c, d = stats.relfreq(arr1, numbins = 4) print ("cumulative frequency : ", a) print ("Lower Limit : ", b) print ("bin size : ", c) print ("extra-points : ", d) Output : Array element : [1, 3, 27, 2, 5, 13] cumulative frequency : [0.66666667 0.16666667 0. 0.16666667] Lower Limit : -3.333333333333333 bin size : 8.666666666666666 extra-points : 0 Code #2: Python3 1== # relative frequency from scipy import stats import numpy as np arr1 = [1, 3, 27, 2, 5, 13] print ("Array element : ", arr1, "\n") a, b, c, d = stats.relfreq(arr1, numbins = 4, weights = [.1, .2, .1, .3, 1, 6]) print ("cumfreqs : ", a) print ("lowlim : ", b) print ("binsize : ", c) print ("extrapoints : ", d) Output : Array element : [1, 3, 27, 2, 5, 13] cumfreqs : [0.26666667 1. 0. 0.01666667] lowlim : -3.333333333333333 binsize : 8.666666666666666 extrapoints : 0 Comment More infoAdvertise with us Next Article sciPy stats.relfreq() function | Python V vishal3096 Follow Improve Article Tags : Python Python-scipy Python scipy-stats-functions Practice Tags : python Similar Reads sciPy stats.describe() function | Python scipy.stats.describe(array, axis=0) computes the descriptive statistics of the passed array elements along the specified axis of the array. Parameters : array: Input array or object having the elements to calculate the statistics. axis: Axis along which the statistics is to be computed. By default a 2 min read scipy stats.kurtosis() function | Python scipy.stats.kurtosis(array, axis=0, fisher=True, bias=True) function calculates the kurtosis (Fisher or Pearson) of a data set. It is the fourth central moment divided by the square of the variance. It is a measure of the "tailedness" i.e. descriptor of shape of probability distribution of a real-va 2 min read scipy stats.normaltest() function | Python scipy.stats.normaltest(array, axis=0) function test whether the sample is different from the normal distribution. This function tests the null hypothesis of the population that the sample was drawn from. Parameters : array : Input array or object having the elements. axis : Axis along which the norm 1 min read scipy stats.chi() | Python scipy.stats.chi() is an chi continuous random variable that is defined with a standard format and some shape parameters to complete its specification. Parameters : q : lower and upper tail probability x : quantiles loc : [optional] location parameter. Default = 0 scale : [optional] scale parameter. 2 min read scipy stats.f() | Python scipy.stats.f() is an F continuous random variable that is defined with a standard format and some shape parameters to complete its specification. Parameters : q : lower and upper tail probability a, b : shape parameters x : quantiles loc : [optional] location parameter. Default = 0 scale : [optiona 2 min read Like