[Numpy-discussion] Standard functions (z-score) on nan (again)

Peter Saffrey pzs@dcs.gla.ac...
Thu Sep 25 03:46:25 CDT 2008


I've bodged my way through my median problems (see previous postings). Now I
need to take a z-score of an array that might contain nans. At the moment, if
the array, which is 7000 elements, contains 1 nan or more, all the results come
out as nan. 

My other problem is that my array is indexed from somewhere else - position 0
holds the value for a particular id, position 1 holds the value for a particular
id and so on, so if I remove the nans, all the indices are messed up. Can
anybody suggest a sensible fix for this problem?

I know I should really be using masked arrays, but I can't seem to find a
masked-array version of zs. Is there one?

Peter



More information about the Numpy-discussion mailing list