data = ('AB', 'asd'), ('AB', 'poi'), ('AB', 'asd'), ('BG', 'put'), ('BG', 'asd'
    )
unique_items = set(data)
keys = [[entry[0] for entry in unique_items]]
for key in set(keys):
    pass
python count number of unique elements in csv column