replace value in column where condition is met code example Example: replace values in a column by condition python df.loc[df['employrate'] > 70, 'employrate'] = 7