for loop replace column dataframe python code example
Example 1: replace column values pandas
df['column'] = df['column'].str.replace(',','-')
df
Example 2: pandas dataframe replace inf
df.replace([np.inf, -np.inf], np.nan)
df['column'] = df['column'].str.replace(',','-')
df
df.replace([np.inf, -np.inf], np.nan)