While answering the question Vectorize calculation of a Pandas Dataframe, I noticed an interesting issue regarding performance.
I was under the impression that funct
Pandas can deal with NaN, you can check the difference by:
a = np.random.randn(1000000) %timeit np.nancumsum(a) %timeit np.cumsum(a)
outputs:
9.02 ms ± 189 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) 4.37 ms ± 18.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)