1

I'm looking for a way of computing standard deviations from samples that allows the inclusion of sample weights.

numpy.average does that:

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.

, however, np.std() does not. Is there an alternative?

FooBar
  • 15,724
  • 19
  • 82
  • 171

0 Answers0