# 1. Replace a single value with a new value for an individual DataFrame column:
df['column name'] = df['column name'].replace(['old value'],'new value')
# 2. Replace multiple values with a new value for an individual DataFrame column:
df['column name'] = df['column name'].replace(['1st old value','2nd old value',...],'new value')
# 3. Replace multiple values with multiple new values for an individual DataFrame column:
df['column name'] = df['column name'].replace(['1st old value','2nd old value',...],['1st new value','2nd new value',...])
# 4. Replace a single value with a new value for an entire DataFrame:
df = df.replace(['old value'],'new value')
df['column'] = df['column'].str.replace(',','-')
df
df['coloum'] = df['coloum'].replace(['value_1','valu_2'],'new_value')
df.loc[df['column'] == 'column_value', 'column'] = 'new_column_value'
# this will replace "Boston Celtics" with "Omega Warrior"
df.replace(to_replace ="Boston Celtics",
value ="Omega Warrior")
df.replace([np.inf, -np.inf], np.nan)
df.replace([0, 1, 2, 3], [4, 3, 2, 1])