[SciPy-user] removing NaN...

Pierre GM pgmdevlist@gmail....
Mon Jun 25 10:42:20 CDT 2007


On Monday 25 June 2007 11:22:48 fred wrote:
> Hi,
>
> I work on data arrays with many NaN.
>
> How can I remove them and find min & max values ?

First possibility: mask the NaNs, then use .min and .max
data = masked_array(data, mask=isnan(data))

Second possibility:
use nanmax & nanmin

http://www.scipy.org/Numpy_Example_List_With_Doc


More information about the SciPy-user mailing list