By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,525 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,525 IT Pros & Developers. It's quick & easy.

Re: ignoring NAs in a dataset with numpy

P: n/a
mrafi wrote:
Hey All,
I am working with numpy
I have a data set with a lot of nan values, and i want to calculate standard
is there a direct function to do it for example nansum(or something like
to calculate standard deviation ignoring nan values??
You will want to ask numpy questions on the numpy-discussion mailing list.

scipy.stats.nanstd() implements this. Additionally, data[~isnan(data)].std()
works unless if you need to apply the std() along just one axis.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Oct 28 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.