replace 0 wiith 1 in pandas column code example
Example 1: replacing values in pandas dataframe
df['coloum'] = df['coloum'].replace(['value_1','valu_2'],'new_value')
Example 2: how to replace zero value in python dataframe
nonzero_mean = df[ df.col != 0 ].mean()