I have a list of lists that looks like this:
c = [['470', '4189.0', 'asdfgw', 'fds'],
['470', '4189.0', 'qwer', 'fds'],
['470', '4189.0', 'qwer', 'dsfs fdv']
...]
chas about 30,000 internal listings. What I would like to do is to eliminate duplicates based on the 4th item in each internal list. Thus, the list of the above lists will look like this:
c = [['470', '4189.0', 'asdfgw', 'fds'],['470', '4189.0', 'qwer', 'dsfs fdv'] ...]
Here is what I still have:
d = []
d.append(c[0])
for bact in c:
for items in d:
if bact[3] != items[3]:
d.append(bact)
I think this should work, but it just starts and starts. I let him work for 30 minutes and then killed him. I don’t think the program should take so much time, so I assume that something is wrong with my logic.
, . , , , , . , , , .