I am trying to count unique words in a list/set (or whatever its called) that looks something like this:
names = [[], [], [], [], [], [['John ', 'John '], ['Peter ']], [], [], [], [['Morgan']], [], [], []]
(In case you need to know, this list was formed as a result of a match function that looks for a list of names in word documents in a directory on my computer. The empty spaces you see are documents that matched nothing)
So far I have tried
names1 = set(names)
len (names1)
And
Counter(names).keys()
Counter(names).values()
but neither worked. Any help is appreciated