I know it is easy to remove duplicate items from a list such as:
lst = ['a' , 'b' , 'c' , 'c' , 'd' , 'd' ]
by using the method:
lst = list(dict.fromkeys(lst))
#output
lst = ['a' , 'b' , 'c' , 'd']
However this method does not work if the list is made up of 2 element lists like this:
lst = [['a','1'],['b','2'],['b','1'],['c','3'],['c','2']]
I would like to remove all the entries where the first element is duplicated, leaving behind the first instance of each regardless of the second element. So the output should be:
lst = [['a','1'],['b','2'],['c','3']]