I have a list of lists and need to eliminate all lists that have the same 3rd element, and save 1.
For example:
x=[[1,2,3],[1,3,3],[5,6,3],[2,4,6],[8,5,9],[10,5,9]]
could turn into:
x=[[1,2,3],[2,4,6],[8,5,9]]
I've attempted a solution that eliminates all lists that have the same 2nd index using lambda, but I don't know how to save one of each element like set() does--I just get:
x=[[2,4,6]]
[1,3,3]and[5,6,3]go?[1, 2, 3]was kept. It's not clear whether the OP means index 2 counting from 0, or second element counting from 1.