SciPy

scipy.stats.skew

scipy.stats.skew(a, axis=0, bias=True, nan_policy='propagate')[source]

Compute the skewness of a data set.

For normally distributed data, the skewness should be about 0. For unimodal continuous distributions, a skewness value > 0 means that there is more weight in the right tail of the distribution. The function skewtest can be used to determine if the skewness value is close enough to 0, statistically speaking.

Parameters:

a : ndarray

data

axis : int or None, optional

Axis along which skewness is calculated. Default is 0. If None, compute over the whole array a.

bias : bool, optional

If False, then the calculations are corrected for statistical bias.

nan_policy : {‘propagate’, ‘raise’, ‘omit’}, optional

Defines how to handle when input contains nan. ‘propagate’ returns nan, ‘raise’ throws an error, ‘omit’ performs the calculations ignoring nan values. Default is ‘propagate’.

Returns:

skewness : ndarray

The skewness of values along an axis, returning 0 where all values are equal.

References

[R696]Zwillinger, D. and Kokoska, S. (2000). CRC Standard Probability and Statistics Tables and Formulae. Chapman & Hall: New York. 2000. Section 2.2.24.1

Examples

>>> from scipy.stats import skew
>>> skew([1, 2, 3, 4, 5])
0.0
>>> skew([2, 8, 0, 4, 1, 9, 9, 0])
0.2650554122698573

Previous topic

scipy.stats.normaltest

Next topic

scipy.stats.skewtest