Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Incorrect rolling std #54518

Open
2 of 3 tasks
ChiQiao opened this issue Aug 12, 2023 · 4 comments
Open
2 of 3 tasks

BUG: Incorrect rolling std #54518

ChiQiao opened this issue Aug 12, 2023 · 4 comments
Labels
Bug Window rolling, ewma, expanding

Comments

@ChiQiao
Copy link

ChiQiao commented Aug 12, 2023

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
s = pd.Series([1.2e+03, 1.3e+17, 1.5e+17, 1.995e+03, 1.990e+03])
s.rolling(2).std()

Issue Description

The output is

0             NaN
1    9.192388e+16
2    1.414214e+16
3    1.060660e+17
4    0.000000e+00
dtype: float64

In fact, for any values afterwards with a similar magnitude (e.g., 1.234e+03), the rolling std is always 0.

Expected Behavior

0             NaN
1    9.192388e+16
2    1.414214e+16
3    1.060660e+17
4    3.535534e+00
dtype: float64

Installed Versions

INSTALLED VERSIONS

commit : 0f43794
python : 3.9.15.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.16.3-microsoft-standard-WSL2
Version : #1 SMP Fri Apr 2 22:23:49 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8

pandas : 2.0.3
numpy : 1.25.1
pytz : 2023.3
dateutil : 2.8.2
setuptools : 68.0.0
pip : 23.1.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.7.0
pandas_datareader: None
bs4 : 4.12.2
bottleneck : None
brotli : 1.0.9
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : 2.3.1
pyqt5 : None

@ChiQiao ChiQiao added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 12, 2023
@jesse-sealand
Copy link

Same issue:

python : 3.11.4
python-bits : 64
OS : Windows

@jbrockmendel jbrockmendel added the Window rolling, ewma, expanding label Nov 1, 2023
@mroeschke mroeschke removed the Needs Triage Issue that has not been reviewed by a pandas team member label Jul 17, 2024
@matsidzi
Copy link
Contributor

matsidzi commented Aug 17, 2024

Possibly duplicate of #53289 (which is the duplicate of #52407).

@kaixiongg
Copy link

Possibly duplicate of #53289 (which is the duplicate of #52407).

#52407 has been already taken for one year without any update, maybe assign others to this task?

@rhshadrach
Copy link
Member

maybe assign others to this task?

We do not assign issues to contributors; contributors take what issues they are interested in working on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Window rolling, ewma, expanding
Projects
None yet
Development

No branches or pull requests

7 participants