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

Regression in artihmetic ops with alignment and special cases #32685

Closed
TomAugspurger opened this issue Mar 13, 2020 · 3 comments · Fixed by #32734
Closed

Regression in artihmetic ops with alignment and special cases #32685

TomAugspurger opened this issue Mar 13, 2020 · 3 comments · Fixed by #32734
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

TomAugspurger commented Mar 13, 2020

I think 1.0.2 has a regression in arithmetic when we align but the result of op(a, NA) isn't NA. For example 1**np.nan should be 1.

Previous

In [3]: pd.__version__
Out[3]: '1.0.1'

In [4]: pd.DataFrame({"A": [0, 1, 2]}) ** pd.DataFrame(index=[0, 1, 2])
Out[4]:
     A
0  NaN
1  1.0
2  NaN

1.0.2 / master

In [1]: import pandas as pd

In [2]: pd.DataFrame({"A": [0, 1, 2]}) ** pd.DataFrame(index=[0, 1, 2])
Out[2]:
    A
0 NaN
1 NaN
2 NaN

Most likely from #31679. cc @jbrockmendel if you have a chance to look (I won't today).

Are there any other special cases?

@TomAugspurger TomAugspurger added the Numeric Operations Arithmetic, Comparison, and Logical operations label Mar 13, 2020
@TomAugspurger TomAugspurger added this to the 1.0.3 milestone Mar 13, 2020
@TomAugspurger
Copy link
Contributor Author

(this may warrant a somewhat hasty 1.0.3 release).

@jbrockmendel
Copy link
Member

#31679 promises to be a source of endless headaches

@jbrockmendel
Copy link
Member

i think this would be addressed by, instead of operating on left.columns.intersection(right.columns) also any columns in either that are numeric dtypes.

@TomAugspurger TomAugspurger added the Regression Functionality that used to work in a prior pandas version label Mar 14, 2020
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