Skip to content

IntegerArray divide by zero returns NaN instead of inf #27398

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

Closed
TomAugspurger opened this issue Jul 15, 2019 · 1 comment · Fixed by #30183
Closed

IntegerArray divide by zero returns NaN instead of inf #27398

TomAugspurger opened this issue Jul 15, 2019 · 1 comment · Fixed by #30183
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@TomAugspurger
Copy link
Contributor

In [4]: np.array([1]) / np.array([0])
/Users/taugspurger/.virtualenvs/pandas-dev/bin/ipython:1: RuntimeWarning: divide by zero encountered in true_divide
  #!/Users/taugspurger/Envs/pandas-dev/bin/python
Out[4]: array([inf])

In [7]: pd.array([1], dtype='Int64') / 0
Out[7]: array([nan])
@jbrockmendel
Copy link
Member

Yah, we changed/fixed the Series behavior, but IntegerArray, SparseArray (and I think RangeIndex) got left behind. IntegerArray I'm planning handling in a follow-up, SparseArray I haven't figured out how to do

@jbrockmendel jbrockmendel added the Numeric Operations Arithmetic, Comparison, and Logical operations label Jul 21, 2019
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Dec 10, 2019
When dividing by 0, the result should be `inf`, not `NaN`.

Closes pandas-dev#27398
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Dec 10, 2019
When dividing by 0, the result should be `inf`, not `NaN`.

Closes pandas-dev#27398
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Dec 10, 2019
When dividing by 0, the result should be `inf`, not `NaN`.

Closes pandas-dev#27398
@jreback jreback added this to the 1.0 milestone Dec 11, 2019
jorisvandenbossche pushed a commit that referenced this issue Dec 11, 2019
When dividing by 0, the result should be `inf`, not `NaN`.
Closes #27398
proost pushed a commit to proost/pandas that referenced this issue Dec 19, 2019
When dividing by 0, the result should be `inf`, not `NaN`.
Closes pandas-dev#27398
proost pushed a commit to proost/pandas that referenced this issue Dec 19, 2019
When dividing by 0, the result should be `inf`, not `NaN`.
Closes pandas-dev#27398
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants