0

I have some temperature readings that are less than 0 that I want to replace with NaN

I tried this approach but it replaced other values like humidity also as NaN

Df[Df['Temp'] <0] = np.nan

I expect Temp values that are below 0 to be set as NaN without affecting corresponding humidity value

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Sakib Shahriar
  • 121
  • 1
  • 12

1 Answers1

0
df.loc[df['Temp']<0,'Temp']=np.nan
tawab_shakeel
  • 3,701
  • 10
  • 26