I have a list of srings:
lista = ['Word', 'Apple', 'Banana']
How can I convert this into regex:
reg = "\b(word1|word2|word3)\b"
My target is to speed-up my function (for a dataframe):
df['A'] = df['A'].replace(reg, r'\XXX', regex=True)
I have a list of srings:
lista = ['Word', 'Apple', 'Banana']
How can I convert this into regex:
reg = "\b(word1|word2|word3)\b"
My target is to speed-up my function (for a dataframe):
df['A'] = df['A'].replace(reg, r'\XXX', regex=True)