pandas replace regex example
Example: pandas replace values in column regex
# replace the matching strings
df_updated = df.replace(to_replace ='[nN]ew', value = 'New_', regex = True)
# Print the updated dataframe
print(df_updated)
# replace the matching strings
df_updated = df.replace(to_replace ='[nN]ew', value = 'New_', regex = True)
# Print the updated dataframe
print(df_updated)