Skip to content

Mean is incorrectly NaN in 'object' DataFrame #676

Closed
@craustin

Description

@craustin

from pandas import DataFrame
df = DataFrame({0: [np.nan, 2], 1: [np.nan, 3], 2: [np.nan, 4]}, dtype=object)
df.mean(1)

Expected:
In [33]: df.mean(1)
Out[33]:
0 NaN
1 3.0

Actual:
In [31]: df.mean(1)
Out[31]:
0 NaN
1 NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions