{ } Raw JSON

bundles / scipy latest / scipy / stats / _stats_py / describe

function

scipy.stats._stats_py:describe

source: /scipy/stats/_stats_py.py :1470

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_like

Input data.

axis : int or None, optional

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

ddof : int, optional

Delta degrees of freedom (only for variance). Default is 1.

bias : bool, optional

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

nan_policy : {'propagate', 'raise', 'omit'}, optional

Defines 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 ints

Number 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 floats

Minimum and maximum value of a along the given axis.

mean : ndarray or float

Arithmetic mean of a along the given axis.

variance : ndarray or float

Unbiased variance of a along the given axis; denominator is number of observations minus one.

skewness : ndarray or float

Skewness of a along 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 float

Kurtosis (Fisher) of a along the given axis. The kurtosis is normalized so that it is zero for the normal distribution. No degrees of freedom are used.

Raises

: ValueError

If size of a is 0.

Notes

Array API Standard Support

describe has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.

====================  ====================  ====================
Library               CPU                   GPU
====================  ====================  ====================
NumPy                 ✅                     n/a                 
CuPy                  n/a                   ✅                   
PyTorch               ✅                     ✅                   
JAX                   ⚠️ no JIT             ⚠️ no JIT           
Dask                  ⚠️ computes graph     n/a                 
====================  ====================  ====================

See dev-arrayapi for more information.

Examples

import numpy as np
from scipy import stats
a = np.arange(10)
stats.describe(a)
b = [[1, 2], [3, 4]]
stats.describe(b)

See also

kurtosis
skew

Aliases

  • scipy.stats.describe

Referenced by