Skip to content

Bug in DataFrame.rfloordiv when alignment for different columns and index. #27464

Closed
@TomAugspurger

Description

@TomAugspurger

I think that .loc[0, 'A'] should be inf.

In [36]: a = pd.DataFrame({"A": [0, 1, 2], 'B': [1.1, None, 1.1]})

In [37]: b = pd.DataFrame({"A": [1.1, 1.2, 1.3]}, index=[0, 2, 3])

In [38]: a.rfloordiv(b, fill_value=1)
Out[38]:
     A    B
0  NaN  0.0
1  1.0  NaN
2  0.0  0.0
3  1.0  NaN

to match

In [49]: a.rfloordiv(1.1, fill_value=1)
Out[49]:
     A    B
0  inf  1.0
1  1.0  1.0
2  0.0  1.0

cc @jbrockmendel

Metadata

Metadata

Assignees

No one assigned

    Labels

    Numeric OperationsArithmetic, Comparison, and Logical operationsRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions