How to compare three lists?
Hi All!
I have a data set that has 3 columns. these 3 columns are having a list of words. I need to compare one list with 2 other lists(master lists) and get the count of words belongs list1 and list2. list1 and list2 are having unique words as master lists. list3 has words that belong to list1 and list2.
sample data:
list1 list2 list3
shape,size,whole type,diff,lit shape,lit
hole,jio,kit pen,tilm,mil pen,mil
Required output:
list1 list2 list3 count_list1 count_list2
shape,size,whole type,diff,lit shape,lit 1 1
hole,jio,kit pen,tilm,mil pen,kit 0 2
here list3 has
i. "shape","kit": "shape" is available in list1 so, count of list1 is "1" and "lit" is available in list2 so, the count_list2 is "1"
ii. "pen","kit" : "pen" and "kit" are avaialble in list2, the count_list2 is "2" and count_list1 is "0" because none of the words belongs to list1.
could anyone help me in resolving this?
Thanks in Advance!