nimble.calculate.standardDeviation

nimble.calculate.standardDeviation(values, sample=True)

The standard deviation of the values in a vector.

This function requires numeric data and ignores any NaN values. Non-numeric values will results in NaN being returned.

Parameters:
  • values (nimble Base object) – Must be one-dimensional.

  • sample (bool) – If True, the default, the sample standard deviation is returned. If False, the population standard deviation is returned.

Examples

>>> lst = [1, 2, 3, 4, 5, 6, float('nan')]
>>> vector = nimble.data(lst)
>>> standardDeviation(vector)
1.8708286933869707
>>> standardDeviation(vector, sample=False)
1.707825127659933