df replace 0 with nan code example
Example 1: replace nan in pandas
df['DataFrame Column'] = df['DataFrame Column'].fillna(0)
Example 2: replace "-" for nan in dataframe
df.replace(np.nan,0)
Example 3: dataframe fillna with 0
df['column'] = df['column'].fillna(0)
Example 4: how to replace zero with null in python
df2.loc[df2['Weight'] == 0,'Weight'] = np.nan
df2.loc[df2['Height'] == 0,'Height'] = np.nan
df2.loc[df2['BootSize'] == '0','BootSize'] = np.nan
df2.loc[df2['SuitSize'] == '0','SuitSize'] = np.nan