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

State: Experimental as of 0.4.0. specified axis.

Parameters:
  • a (array_like) – Calculate average and standard deviation of these values.
  • axis (int, optional) – Axis along which the statistics are computed. The default is to compute them on the flattened array.
  • weights (array_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_mean (bool, optional, defaults to True) – Compute average if True.
  • with_std (bool, optional, defaults to True) – Compute standard deviation if True.
  • ddof (int, 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:

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

Return type:

average, std