Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: ignoring NAs in a dataset with numpy

Reply
Thread Tools

Re: ignoring NAs in a dataset with numpy

 
 
Robert Kern
Guest
Posts: n/a
 
      10-28-2008
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
> deviation
> is there a direct function to do it for example nansum(or something like
> this),
> to calculate standard deviation ignoring nan values??


You will want to ask numpy questions on the numpy-discussion mailing list.

http://www.scipy.org/Mailing_Lists

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ignoring NAs in a dataset with numpy mrafi Python 0 10-28-2008 10:10 AM
ignoring NAs in a dataset with numpy mrafi Python 0 10-28-2008 08:08 AM
NumPy Question - numpy.put in multi-dimensional array Bryan.Fodness@gmail.com Python 2 11-13-2007 10:36 PM
numpy migration (also posted to numpy-discussion) Duncan Smith Python 3 04-25-2007 01:36 AM
Trouble with numpy-0.9.4 and numpy-0.9.5 drife Python 1 03-01-2006 05:59 PM



Advertisments