I have an array A on python that has some nan values created by numpy.nan. I want to set all the nan values to zero using A[A==numpy.nan] = 0. It doesn\'t chang
A[A==numpy.nan] = 0
You can use the numpy function to change all the nan value at matrix x to zero.
numpy.nan_to_num(x)