Skip to content

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

Closed
@mroeschke

Description

@mroeschke
>>> 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 <jbrockmendel@gmail.com>
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions