Python Pandas: error: missing ), unterminated subpattern at position 2
A more general solution would be to escape the input token using re.escape
import re
inputToken = '((('
df['Title'] = df['Title'].str.replace(re.escape(inputToken), '>>')
replace
in pandas
lets you use regex
and (
has special meaning in regex
so use \(
df['Title'] = df['Title'].str.replace('\(\(\(', '>>')
pandas doc: pandas.Series.str.replace