Skip to content

grouped.filter with dropna option #10780

Closed
@leo4183

Description

@leo4183

in Pandas 0.16.2:

grouped = a.groupby(idx)
grouped.filter(lambda x: x.mean()>0.0, dropna=False)

in case there was no group whose x.mean() was larger than zero, an AttributeError: 'list' object has no attribute 'astype' would be raised (rather than returning an all NaN dataframe/serie in previous versions).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions