(Nov-22-2022, 01:22 PM)NeoXx Wrote: At the moment I use iterrows() with two if statements if the price goes up or down by $1, and a variable that saves the price from the row we are comparing new prices with. However this is very slow.Look at How To Make Your Pandas Loop 71803 Times Faster
So
Vectorization
is way to go to make this faster.Quote:We use the advantages of vectorization to create really fast codes.
The point is to avoid Python-level loops like in the examples before [1]
and to use optimized C code which uses the memory much more efficient.