I want to replace a float64 variable with NaN when it has a value of zero (it does not have a value of zero all the time). I tried using
df["Temp"].replace(0.,np.nan)
but it didn't have any affect. Appreciate your help.
You can alternatively try:
df.loc[df['temp']==0, 'temp'] = np.nan
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments