pandas put zero in Nan code example
Example 1: how to replace nan values with 0 in pandas
df.fillna(0)
Example 2: how to replace zero value in python dataframe
nonzero_mean = df[ df.col != 0 ].mean()
df.fillna(0)
nonzero_mean = df[ df.col != 0 ].mean()