'Invalid escape sequence Python

I'm doing a sentiment analysis. However I am making a mistake cleaning the tweets. How should the sequence be? :6: DeprecationWarning: invalid escape sequence \w remove_rt = lambda x: re.sub('rt @\w+: ',"",x) :7: DeprecationWarning: invalid escape sequence \w rt = lambda x: re.sub('(@[A-Za-z0–9]+)|([ A-Za-z \t])|(\w+://\S+)',"",x)

Cleaning Text (RT, Punctuation etc) #Creating new dataframe and new features tw_list = pd.DataFrame(data_all) tw_list["text_Clean"] = tw_list["text"] #Removing RT, Punctuation etc remove_rt = lambda x: re.sub('rt @\w+: ',"",x) rt = lambda x: re.sub('(@[A-Za-z0–9]+)|([ A-Za-z \t])|(\w+://\S+)',"",x) tw_list["text_Clean"] = tw_list.text_clean.map(remove_rt).map(rt) tw_list["text_Clean"] = tw_list.text_clean.str.lower() tw_list.head(10)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source