keyword-search

pandas findall re.ignorecase doesn't work

Pandas findall re.IGNORECASE doesn't work Question: I have a list of keywords: keywords = [‘fake’, ‘hoax’, ‘misleading’, etc.] I’d like to search the text column of DataFrame df1 for the above keywords and return rows containing these keywords (exact match), both in uppercase and lowercase (case-insensitive). I tried the following: df2 = df1[df1.text.apply(lambda x: any(i …

Total answers: 1