Using pandas .append within for loop
Every time you call append, Pandas returns a copy of the original dataframe plus your new row. This is called quadratic copy, and it is an O(N^2) operation that will quickly become very slow (especially since you have lots of data). In your case, I would recommend using lists, appending to them, and then calling … Read more