pyinterp.DescriptiveStatistics#

class pyinterp.DescriptiveStatistics(values: dask.array.core.Array | numpy.ndarray, weights: None | dask.array.core.Array | numpy.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.

. seealso:

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()

Returns the different statistical variables calculated in a numpy structured table with the following fields:

copy()

Creates a copy of the current descriptive statistics container.

count()

Returns the count of samples.

kurtosis()

Returns the kurtosis of samples.

max()

Returns the maximum of samples.

mean()

Returns the mean of samples.

min()

Returns the minimum of samples.

skewness()

Returns the skewness of samples.

std([ddof])

Returns the standard deviation of samples.

sum()

Returns the sum of samples.

sum_of_weights()

Returns the sum of weights.

var([ddof])

Returns the variance of samples.

Special Methods

__add__(other)

Adds a new descriptive statistics container to the current one.

__iadd__(other)

Adds a new descriptive statistics container to the current one.

__str__()

Return str(self).