import numpy as np
a = np.array([1,2,3,4,5,6,7,8,9])
b = np.where (a==3,np.nan,a)
print (b) #OK, can convert certain values (e.g. 3) into np.nan
c = np.where (b==np.nan,3,b)
print (c)
But does not work! Could not convert np.nan into 3.
How can I convert np.nan in the array c into the value 3?
The result (array c) should be same as the original array a.