Skip to content

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

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 19, 2019 · 1 comment · Fixed by #28024
Closed

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

TomAugspurger opened this issue Jul 19, 2019 · 1 comment · Fixed by #28024
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@TomAugspurger
Copy link
Contributor

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

@TomAugspurger TomAugspurger added this to the 0.25.1 milestone Jul 19, 2019
@TomAugspurger TomAugspurger added Numeric Operations Arithmetic, Comparison, and Logical operations Regression Functionality that used to work in a prior pandas version labels Jul 19, 2019
@jbrockmendel
Copy link
Member

Looks like we get the expected result if we do the same with a.astype(np.float64)

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 Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants