I am iterating through a pandas dataframe (df) and adding scores to a dictionary containing python lists (scores):
for index, row in df.iterrows():
scores[row["key"]][row["pos"]] = scores[row["key"]][row["pos"]] + row["score"]
The scores dictionary initially is not empty. The dataframe is very large and this loop takes a long time. Is there a way to do this without a loop or speed it up in some other way?