Replace 0 with blank in dataframe Python pandas
pandas, python, replace
Solution
data_usage_df = data_usage_df.astype(str)
data_usage_df['Data Volume (MB)'].replace(['0', '0.0'], '', inplace=True)
Problem
I made the following code that takes out all of the zero's from my df. However when there is a number containing a zero it takes them out as well. ``` e.g. 3016.2 316.2 0.235 .235 data_usage_df['Data Volume (MB)'] = data_usage_df['Data Volume (MB)'].str.replace('0', '') ``` Could you help me to figure out how I do an exact match of the cell that equals 0 and replace it with a blank value.