-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: inconsistent result when groupby then sum values that contain inf #43292
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
Comments
Small comment that may help: |
take |
This regression pops up anywhere we use kahan summation, for example also
These NaNs pop up because we end computing |
perf is secondary to correctness. we also have #39622 open which is reporting a performance degradation. from #39622 (comment)
so that could also be an option. |
Actually rolling returned nan even before we implemented Kahan there. So maybe opening up a separate issue @mzeitlin11 ? |
changing milestone to 1.3.5 |
please fix this before bringing The Wrath of K(a)han upon us |
A pr adressing this is welcome |
removing from 1.3.x milestone, xref #44526 (comment) |
Closed by #53623 |
I have checked that this issue has not already been reported.
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.
Code Sample, a copy-pastable example
Problem description
while directly doing
groupby.sum
, the group withinf
will returnnp.nan
, but if we get the group and dosum
, it returnsnp.inf
Expected Output
groupby.sum
should also returnnp.inf
if the values contiannp.inf
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : c7f7443
python : 3.7.6.final.0
python-bits : 64
OS : Darwin
OS-release : 18.2.0
Version : Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 1.3.1
numpy : 1.21.1
pytz : 2021.1
dateutil : 2.8.2
pip : 21.1.2
setuptools : 57.0.0
Cython : None
pytest : 4.5.0
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : 0.7.11.None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.26.0
pandas_datareader: None
bs4 : 4.9.3
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : 2.7.3
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 3.0.0
pyxlsb : None
s3fs : None
scipy : 1.1.0
sqlalchemy : 1.3.24
tables : 3.5.2
tabulate : 0.7.7
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: