python replace all column values code example
Example 1: replace values of pandas column
df.loc[df['column'] == 'column_value', 'column'] = 'new_column_value'
Example 2: column.replace
df.column = df.coloumn.replace('old_value', 'new_value')
df.loc[df['column'] == 'column_value', 'column'] = 'new_column_value'
df.column = df.coloumn.replace('old_value', 'new_value')