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: Nullable int floordiv 0 result changed from 0 to inf #48223

Closed
mroeschke opened this issue Aug 24, 2022 · 2 comments · Fixed by #48229
Closed

BUG: Nullable int floordiv 0 result changed from 0 to inf #48223

mroeschke opened this issue Aug 24, 2022 · 2 comments · Fixed by #48229
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@mroeschke
Copy link
Member

>>> import pandas as pd
>>> pd.__version__
'1.4.3'
>>> 1 // pd.Series([0], dtype='Int64')
0    0
dtype: Int64

vs

In [1]: pd.__version__
Out[1]: '1.6.0.dev0'  # essentially 1.5

In [2]: 1 // pd.Series([0], dtype='Int64')
Out[2]:
0    inf
dtype: Float64

Ran a bisect and found this was the commit that caused the change

57d7768c205d30cc50ba9b42d60d24d1e32eb249 is the first bad commit
commit 57d7768c205d30cc50ba9b42d60d24d1e32eb249
Author: jbrockmendel <[email protected]>
Date:   Thu Jan 27 16:33:24 2022 -0800

    BUG: NumericArray * td64_array (#45622)

While personally I think inf is a more sensible result than 0, appears this was still being actively discussed in #30188

@mroeschke mroeschke added Bug Numeric Operations Arithmetic, Comparison, and Logical operations labels Aug 24, 2022
@mroeschke mroeschke added this to the 1.5 milestone Aug 24, 2022
@mroeschke
Copy link
Member Author

Appears this was further refactored in #45849 cc @jbrockmendel

@jbrockmendel
Copy link
Member

The old behavior was the bug.

Should add tests for "masked behavior when there are no NAs matches non-masked behavior"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants