Can someone suggest a good solution for removing duplicates from nested lists if you want to evaluate duplicates based on the first element of each nested list?
The main list is as follows:
L = [['14', '65', 76], ['2', '5', 6], ['7', '12', 33], ['14', '22', 46]]
If there is another list with the same element in the first position [k][0] that has already occurred, then I would like to delete this list and get this result:
L = [['14', '65', 76], ['2', '5', 6], ['7', '12', 33]]
Can you suggest an algorithm to achieve this?
python list
elfuego1 Jul 17 '09 at 13:45 2009-07-17 13:45
source share