J Conrado wrote:

> I have a 2d array and I would  how can I replace NaN values for example
> with -9999 value or other value.

>>> a
array([[ nan,   1.,   2.,   3.],
       [  4.,   5.,   6.,   7.],
       [  8.,   9.,  10.,  nan]])
>>> a[numpy.isnan(a)] = 42
>>> a
array([[ 42.,   1.,   2.,   3.],
       [  4.,   5.,   6.,   7.],
       [  8.,   9.,  10.,  42.]])


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to