I have the following data:
data = [('ORG', 'Apple'), ('ORG', 'Microsoft'), ('ORG', 'microsoft'), ('NAME', 'Microsoft')]
print(Counter(data))
I want to group by the tuple second item and then first item. insensitive case. So the result should be (with the count):
[(('ORG', 'apple'),1), (('ORG', 'microsoft'),2), (('NAME', 'Microsoft'),1)]
Note that 3 microsoft
values became 2.
Thanks