I have a problem with two very large files(each more then 1.000.000 entries) in python: I need to generate a filter and I dont know why, I have two files like this:
1,2,3
2,4,5
3,3,4
and the second
1,"fege"
2,"greger"
4,"feffg"
the first item of each file row is always the ID. Now I want to filter the Lists, that the first list only contains items which ID's are in the second file. For this example the result should be:
1,2,3
2,4,5
how to make this in a very fast way? the core problem is, that each list is very very long. I used s.th. like this:
[row for row in myRows if row[0] == item[0]]
but this take a long time to run throw. (more than 30 days)