Here is how I sped up a ML pipeline by 2200%, from almost an hour down to 2.5 minutes. The bottleneck function converts ohlcv market data into sequences of length 100. It took 54m to complete this pure-python loop. ChatGPT wasn't able to rewrite it.