I have z = np.array([4.4, 3, 0, np.nan, -1, 6])
and just can't find any quick and friendly solution for easy replacement. I can't believe it's sometimes such not user friendly language.
I tried:
np.where(z == np.nan, -1, z)
nothing happens
np.nan_to_num(z, -1)
changes to zeros
z = [-1 if np.nan(x) else x for x in z]
TypeError: 'float' object is not callable
Why such earsy things can't be just as pure easy? I must use numpy only.