I'm currently working on moving some excel worksheets over to python automation, and have come across a speed issue.
I have a list of lists containing around 10.000 lists each with 20 or so columns. I also have a list of account numbers (100.000 numbers)
I wish to iterate over my list of lists and then pick out values from the list, if the account number in the lists matches one in the account list.
By running this code, i am able to get my desired result, however it is painfully slow.
calc = 0
for row in listOfLists:
if row[1] in Accounts:
calc += row[8]
Any ideas on how to optimize for speed?