Skip to content

mean over axis=1 in not-completely-numeric frame returns all nans #3689

Closed
@cpcloud

Description

@cpcloud

DataFrame from #3688. This might be related to that:

df = pd.DataFrame({'bar': {0: 1, 1: 1, 2: 1}, 'foo': {0: 0, 1: 1, 2: 2}, 'foo1': {0: 1, 1: 2, 2: 3}, 'hello': {0: 'a', 1: 'a', 2: 'a'}}, columns=['bar', 'foo', 'foo', 'hello'])
print df.T.sum(1) == df.sum()  # fine. + is str cat
print df.T.mean(1).isnull().all()  # prints True

I think non numeric should be dropped...

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNuisance ColumnsIdentifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.applyReduction Operationssum, mean, min, max, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions