Saturday, 17 August 2013

Numpy way to determine the value(s) in an array which is causing a high variance

Numpy way to determine the value(s) in an array which is causing a high
variance

Is there a numpy way to determine the value(s) in an array which is
causing a high variance?
Consider the set of numbers
array([164, 202, 164, 164, 164, 166], dtype=uint16)
A quick scan reveals, 202 would cause a high variance which if I remove
from the list would reduce the variance considerably
>>> np.var(np.array([164, 202, 164, 164, 164, 166]))
196.88888888888886
and removing 202 from the above list would reduce the variance considerably
>>> np.var(np.array([164, 164, 164, 164, 166]))
0.64000000000000012
But, how to determine the offending value?

No comments:

Post a Comment