Profiling Python with py-spy: 169 seconds down to 0.56
A Pandas iterrows() loop over 3.5 million flight records took about 170 seconds. py-spy is a sampling profiler that shows where the time went without slowing the script down, and the vectorized NumPy rewrite does the same work in 0.56 seconds.