pandas replace zero code example
Example 1: pandas replace zero with blank
# in column_B of dataframe, replace zero with blanks
df['column_B'].replace(['0', '0.0'], '', inplace=True)
Example 2: how to replace zero value in python dataframe
nonzero_mean = df[ df.col != 0 ].mean()