Skip to content

BUG: binop methods with fill_value not being respected in pandas 2.2 #57447

Open
@mroeschke

Description

@mroeschke
In [1]: import pandas as pd; from io import StringIO; import numpy as np

In [2]: pd.__version__
Out[2]: '2.1.4'

In [3]: ser = pd.Series(pd.array([1, pd.NA], dtype="Float64"))

In [4]: ser.eq(np.nan, fill_value=0.0).  # 2.1.4
Out[4]: 
0    False
1    False
dtype: boolean

In [4]: ser.eq(np.nan, fill_value=0.0). # 2.2
Out[4]: 
0    False
1     <NA>
dtype: boolean

I would expect fill_value to replace NA with 0.0 before comparing with np.nan as described in the docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNA - MaskedArraysRelated to pd.NA and nullable extension arraysNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions