Python replace specific value with some constant

  Uncategorized
Replace NaN in dataframe with ”

df_confirmed = df_confirmed.replace(np.nan, '', regex=True)
Fill NaN with another column
Day  col1  col2
1    1     a
2    NaN   b

df['col1'].fillna(df['col2'])
Day  col1  col2
1    1     a
2    b     b
Replace NaN with 0

df['DataFrame Column'] = df['DataFrame Column'].fillna(0)
Replace all NaN in df

df.fillna(0)