this is in reference to the issue I raised here: compare two pandas dataframes with unequal columns
also in reference: How to implement 'in' and 'not in' for Pandas dataframe
I have created two pandas data frames :
DataFrame: words
0
0 limited
1 desirable
2 advices
DataFrame: mcDonaldWL
Word Negative Positive Uncertainty
9 abandon 2009 0 0
10 abandoned 2009 0 0
11 desirables 0 2009 0
12 abandonment 2009 0 0
13 advices 2009 0 0
14 abandons 2009 0 0
My goal here is to compare words[0] to mcDonaldWL['Word'] and if the ith element occurs, present the results.
Result
Word Negative Positive Uncertainty
11 desirables 0 2009 0
13 advices 2009 0 0
I tried to use set, intersection, merge, but can't find a solution. Any thoughts?
It does not generate the required answer. This is not duplicate.
If I run
words[~words.word.isin(mcDonaldWL)]
I get:
word
0 limited
1 desirable