# in column_B of dataframe, replace zero with blanks df['column_B'].replace(['0', '0.0'], '', inplace=True)