Skip to content

Regression in artihmetic ops with alignment and special cases #32685

Closed
@TomAugspurger

Description

@TomAugspurger

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?

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