I have a list of 'words' I want to count below
word_list = ['one','two','three']
And I have a column within pandas dataframe with text below.
TEXT | USER
-------------------------------------------|---------------
"Perhaps she'll be the one for me." | User 1
"Is it two or one?" | User 1
"Mayhaps it be three afterall..." | User 2
"Three times and it's a charm." | User 2
"One fish, two fish, red fish, blue fish." | User 2
"There's only one cat in the hat." | User 3
"One does not simply code into pandas." | User 3
"Two nights later..." | User 1
"Quoth the Raven... nevermore." | User 2
The desired output that I would like is the following below, where I want to count the number of unique users that has text related to any word in word_list, using the data found in the "TEXT" column
Word | Unique User Count
one | 3 User 1/2/3 here
two | 2 User 1/2 here
three| 1 User 2 here
Is there a way to do this in Python 2.7?