I have this list of lists in Python:
[[100,XHS,0],
[100,34B,3],
[100,42F,1],
[101,XHS,2],
[101,34B,5],
[101,42F,2],
[102,XHS,1],
[102,34B,2],
[102,42F,0],
[103,XHS,0],
[103,34B,4],
[103,42F,2]]
and I would like to find the most efficient way (I'm dealing with a lot of data) to create a new list of lists using the last element from each list for each id (the first element).. So for the sample list above, my result would be:
[[0,3,1],
[2,5,2],
[1,2,0],
[0,4,2]]
How can I implement this in Python? Thanks