I’ve got an application where I need both the average and the standard deviation of a list of data.
Numpy can calculate both with np.avg
and np.std
. However, np.std
does not give the average, even though you need the average to calculate the standard deviation from first principles. This means I need to use both commands, which is inefficient.
Is there a way to 1) extract the average from np.std
(thereby making it unnecessary to run np.avg
), or 2) to give the output from np.avg
to np.std
(thereby making np.std
evaluate faster)?
The documentation suggests there’s no way, which is unfortunate =/