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 in DataFrame.rfloordiv when alignment for different columns and index. #27464

Closed
TomAugspurger opened this issue Jul 19, 2019 · 1 comment · Fixed by #28024

Comments

@TomAugspurger
Copy link
Contributor

commented Jul 19, 2019

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

@jbrockmendel

This comment has been minimized.

Copy link
Member

commented Jul 19, 2019

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

jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Aug 20, 2019
TomAugspurger added a commit that referenced this issue Aug 20, 2019
BUG: rfloordiv with fill_value, closes#27464 (#28024)
* BUG: rfloordiv with fill_value, #27464, #26793
TomAugspurger added a commit that referenced this issue Aug 20, 2019
galuhsahid added a commit to galuhsahid/pandas that referenced this issue Aug 25, 2019
gabriellm1 added a commit to gabriellm1/pandas that referenced this issue Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.