O'Reilly logo

NumPy Cookbook - Second Edition by Ivan Idris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Skipping NaNs with the nanmean(), nanvar(), and nanstd() functions

It is common to attempt to estimate how variable the arithmetic mean, variance, and standard deviation of a set of data are.

A simple, but effective, method is called jackknife resampling (refer to http://en.wikipedia.org/wiki/Jackknife_resampling). The idea behind jackknife resampling is to create datasets from the original data by leaving out one value each time. In essence, we are attempting to estimate what will occur if at least one of the values is incorrect. For every new dataset, we recalculate the statistical estimator we are interested in. This helps us understand how the estimator varies.

How to do it...

We will apply jackknife resampling to random data. We will skip every ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required