3 ms·
There are several mistakes here. The biggest is not answering the speed vs. memory question up front. Why read in all the data at once when this problem can be
by iandanforth 12y ago
There are several mistakes here. The biggest is not answering the speed vs. memory question up front. Why read in all the data at once when this problem can be solved with a for loop? If the csv's are huge, you need to at least think through the impact of loading them into memory. If speed is your primary goal then showing you know about Pandas or at least Numpy would be preferable. If you then choose to implement the comparison by hand, great, but in the every-day case, knowledge of shortcuts can be the difference between a productive programmer and a slow one.