Series.str.replace()

pandas.Series.str.replace

Series.str.replace(pat, repl, n=-1, case=True, flags=0)

Replace occurrences of pattern/regex in the Series/Index with some other string. Equivalent to str.replace() or re.sub().

Parameters:

pat : string

Character sequence or regular expression

repl