I have a list of lists:
I've been experimenting with different loops and for statements, but can't seem to get it to work. What I'd like to do is keep the entry based on first appearence of the year. For example, list[0]
has a year of 1966 (where list[0][1]
is 1966). This would mean that would stay, but list[4]
would be removed, because list[4][1]
is also in 1966. Any ideas?
An example of something I've tried:
check = -1
yearlist = []
for i in list:
check = check+1
if list[check][1] in yearlist:
list.remove(list[check])
yearlist.append(list[check][1])