bundles / scipy latest / scipy / stats / _stats_py / describe
function
scipy.stats._stats_py:describe
source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_stats_py.py:1454
Signature
def describe(a, axis = 0, ddof = 1, bias = True, nan_policy = propagate)Summary
Compute several descriptive statistics of the passed array.
Parameters
a: array_likeInput data.
axis: int or None, optionalAxis along which statistics are calculated. Default is 0. If None, compute over the whole array
a.ddof: int, optionalDelta degrees of freedom (only for variance). Default is 1.
bias: bool, optionalIf False, then the skewness and kurtosis calculations are corrected for statistical bias.
nan_policy: {'propagate', 'raise', 'omit'}, optionalDefines how to handle when input contains nan. The following options are available (default is 'propagate'):
'propagate': returns nan
'raise': throws an error
'omit': performs the calculations ignoring nan values
Returns
nobs: int or ndarray of intsNumber of observations (length of data along
axis). When 'omit' is chosen as nan_policy, the length along each axis slice is counted separately.: minmax: tuple of ndarrays or floatsMinimum and maximum value of
aalong the given axis.mean: ndarray or floatArithmetic mean of
aalong the given axis.variance: ndarray or floatUnbiased variance of
aalong the given axis; denominator is number of observations minus one.skewness: ndarray or floatSkewness of
aalong the given axis, based on moment calculations with denominator equal to the number of observations, i.e. no degrees of freedom correction.kurtosis: ndarray or floatKurtosis (Fisher) of
aalong the given axis. The kurtosis is normalized so that it is zero for the normal distribution. No degrees of freedom are used.
Raises
: ValueErrorIf size of
ais 0.
Examples
import numpy as np from scipy import stats a = np.arange(10)✓
stats.describe(a)
✗DescribeResult(nobs=np.int64(10), minmax=(np.int64(0), np.int64(9)), mean=np.float64(4.5), variance=np.float64(9.166666666666668), skewness=np.float64(0.0), kurtosis=np.float64(-1.2242424242424244))
b = [[1, 2], [3, 4]]
✓stats.describe(b)
✗DescribeResult(nobs=np.int64(2), minmax=(array([1, 2]), array([3, 4])), mean=array([2., 3.]), variance=array([2., 2.]), skewness=array([0., 0.]), kurtosis=array([-2., -2.]))
See also
Aliases
scipy.stats.describe