replace a string with a number in pandas code example Example: column.replace df.column = df.coloumn.replace('old_value', 'new_value')