pyinterp.DescriptiveStatistics

class pyinterp.DescriptiveStatistics(values: dask.array.core.Array | NDArray, weights: None | dask.array.core.Array | NDArray = None, axis: int | Iterable[int] | None = None, dtype: numpy.dtype | None = None)[source]

Bases: object

Univariate descriptive statistics.

Calculates the incremental descriptive statistics from the provided values. The calculation of the statistics is done when the constructor is invoked. Different methods allow to extract the calculated statistics.

Parameters:
  • values

    Array containing numbers whose statistics are desired.

    Note

    NaNs are automatically ignored.

  • weights – An array of weights associated with the values. If not provided, all values are assumed to have equal weight.

  • axis – Axis or axes along which to compute the statistics. If not provided, the statistics are computed over the flattened array.

  • dtype – Data type of the returned array. By default, the data type is numpy.float64.

See also

Pébay, P., Terriberry, T.B., Kolla, H. et al. Numerically stable, scalable formulas for parallel and online computation of higher-order multivariate central moments with arbitrary weights. Comput Stat 31, 1305-1325, 2016, https://doi.org/10.1007/s00180-015-0637-z

Public Methods

array()

Get the statistical variables as a structured numpy array.

copy()

Create a copy of the current descriptive statistics container.

count()

Get the count of samples.

kurtosis()

Get the kurtosis of samples.

max()

Get the maximum of samples.

mean()

Get the mean of samples.

min()

Get the minimum of samples.

skewness()

Get the skewness of samples.

std([ddof])

Get the standard deviation of samples.

sum()

Get the sum of samples.

sum_of_weights()

Get the sum of weights.

var([ddof])

Get the variance of samples.

Special Methods

__add__(other)

Add a new descriptive statistics container to the current one.

__iadd__(other)

Add a new descriptive statistics container to the current one.

__str__()

Get the string representation of the descriptive statistics.