from functools import reduce
search_data = [['list', 'of', '150k', 'words'], ['another', 'list', 'of',
    '150k', 'words'], ['yet', 'another', 'list', 'of', '150k', 'words']]
search_words = ['four', 'hundred', 'words', 'to', 'search', 'for']

def word_finder(words_to_find):
    lookfor = set(word.lower() for word in words_to_find)

def get_word_count(text):
    return Counter(word for word in (wd.lower() for wd in text) if word in
        lookfor)
return get_word_count

def get_words_in_common(counters):
    return reduce(operator.and_, (set(c) for c in counters))

def main():
    wordcount = word_finder(search_words)
counters = [wordcount(wordlst) for wordlst in search_data]
common_to_all = get_words_in_common(counters)
print(common_to_all)
if __name__ == '__main__':
    main()
Comparing two large lists in python