I have a data frame
0 2021-03-19 14:59:49+00:00 ... I only need uxy to hit 20 eod to make up for a...
1 2021-03-19 14:59:51+00:00 ... Oh this isn’t good
2 2021-03-19 14:59:51+00:00 ... lads why is my account covered in more red ink...
3 2021-03-19 14:59:51+00:00 ... I'm tempted to drop my last 800 into some stup...
4 2021-03-19 14:59:52+00:00 ... The sell offs will continue until moral improves
And i have a list
names = ['SRNE', 'CRSR', 'GME', 'AMC', 'TSLA', 'MVIS', 'SPCE']
I want to check each row for this words if they exist I want to output words that were found in each row Here is what I tried
pat = '|'.join(r"\b{}\b".format(x) for x in names)
df = bearish.set_index('dt')['text'].str.extractall('(' + pat + ')')[0].reset_index(name='tickers')
df1 = pd.crosstab(df['dt'], df['tickers'])
but it gives me an empty df dataframe Thank you