BUG: ewma with time gives strange results with adjust = False vs. True, difference is too large to make sense (original) (raw)
- [ yes ] I have checked that this issue has not already been reported.
- [ yes ] I have confirmed this bug exists on the latest version of pandas.
- (optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
np.random.seed(0) idx=pd.date_range('20000101','20201231',periods=50000) df=pd.DataFrame(data=np.random.normal(0, 1, 50000),index=idx)
exclude first 1000 to avoid un-primed periods
df.ewm(halflife=pd.Timedelta('10d'),times=df.index,adjust=True).mean().iloc[1000:].plot() df.ewm(halflife=pd.Timedelta('10d'),times=df.index,adjust=False).mean().iloc[1000:].plot()
Your code here
Problem description
[this should explain why the current behaviour is a problem and why the expected output is a better solution]
Expected Output
Output of pd.show_versions()
[paste the output of pd.show_versions() here leaving a blank line after the details tag]