based on value in a column replace value in another column code example
Example 1: replace values in a column by condition python
df.loc[df['employrate'] > 70, 'employrate'] = 7
Example 2: column.replace
df.column = df.coloumn.replace('old_value', 'new_value')