pandas dataframe replace na by zero code example
Example 1: pandas replace na with 0
df.fillna(0)
Example 2: pandas replace zero with blank
# in column_B of dataframe, replace zero with blanks
df['column_B'].replace(['0', '0.0'], '', inplace=True)