scikit-bio is back in active development! Check out our announcement of revitalization.

skbio.stats.ordination.mean_and_std#

skbio.stats.ordination.mean_and_std(a, axis=None, weights=None, with_mean=True, with_std=True, ddof=0)[source]#

Compute the weighted average and standard deviation along the specified axis.

Parameters:
aarray_like

Calculate average and standard deviation of these values.

axisint, optional

Axis along which the statistics are computed. The default is to compute them on the flattened array.

weightsarray_like, optional

An array of weights associated with the values in a. Each value in a contributes to the average according to its associated weight. The weights array can either be 1-D (in which case its length must be the size of a along the given axis) or of the same shape as a. If weights=None, then all data in a are assumed to have a weight equal to one.

with_meanbool, optional, defaults to True

Compute average if True.

with_stdbool, optional, defaults to True

Compute standard deviation if True.

ddofint, optional, defaults to 0

It means delta degrees of freedom. Variance is calculated by dividing by n - ddof (where n is the number of elements). By default it computes the maximum likelyhood estimator.

Returns:
average, std

Return the average and standard deviation along the specified axis. If any of them was not required, returns None instead