def replace_pattern(<EOL>df,<EOL>column: str,<EOL>*,<EOL>pat: str,<EOL>repl: str,<EOL>new_column: str = None,<EOL>case: bool = True,<EOL>regex: bool = True<EOL>):
new_column = new_column or column<EOL>df.loc[:, new_column] = df[column].str.replace(pat, repl, case=case, regex=regex)<EOL>return df<EOL>
Replace occurrences of pattern/regex in `column` with some other string
See [pandas doc](
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.replace.html) for more information

---

### Parameters

*mandatory :*
- `column` (*str*): the column
- `pat` (*str*): character sequence or regular expression
- `repl` (*str*): replacement string

*optional :*
- `new_column` (*str*): the destination column (if not set, `column` will be used)
- `case` (*boolean*): if true, case sensitive.
- `regex` (*boolean*): default true