Skip to content

DOC: combine with None at same position in both dataframes #34693

@StefRe

Description

@StefRe

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.combine.html

Documentation problem

The fourth example states:

However, if the same element in both dataframes is None, that None is preserved

In the code sample to illustrate this, however, None is not preserved:

df1 = pd.DataFrame({'A': [0, 0], 'B': [None, 4]})
df2 = pd.DataFrame({'A': [1, 1], 'B': [None, 3]})
df1.combine(df2, take_smaller, fill_value=-5)
    A    B
0  0 -5.0
1  0  3.0

Suggested fix for documentation

If the actual result is the intended behavior, this code sample should be removed. If None should indeed be preserved (but why should it?) then this should be filed as a bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions