PERF: ewm passed with times is so slow compared to ewm pased with int · Issue #39784 · pandas-dev/pandas (original) (raw)


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

Your code here

idx=pd.date_range('20000101','20201231',periods=50000)

df=pd.DataFrame(data=range(50000),index=idx)

%%time df.ewm(halflife=pd.Timedelta('100d'),times=df.index).mean()

CPU times: user 1min 13s, sys: 0 ns, total: 1min 13s Wall time: 1min 13s

%%time df.ewm(halflife=100).mean()

CPU times: user 1.72 ms, sys: 26 µs, total: 1.75 ms Wall time: 1.16 ms

Problem description

ewm passed with times is so slow compared to ewm pased with int

Expected Output

ewm passed with time should be similar speed as ewm passed with int

version 1.2.2