how to replace a string value in dataframe python code example
Example 1: find and replace string dataframe
df['range'] = df['range'].str.replace(',','-')
Example 2: pandas dataframe replace inf
df.replace([np.inf, -np.inf], np.nan)
df['range'] = df['range'].str.replace(',','-')
df.replace([np.inf, -np.inf], np.nan)