Skip to content

BUG: groupby.std with no numeric columns and numeric_only=True raises #51080

Closed
@rhshadrach

Description

@rhshadrach
df = pd.DataFrame({'a': list('xyz'), 'b': list('def')})
gb = df.groupby('a')
print(gb.std(numeric_only=True))

raises TypeError: All columns were dropped in grouped_reduce. Instead, it should return an empty frame with index consisting of the groups.

Metadata

Metadata

Assignees

Labels

BugGroupbyNeeds TestsUnit test(s) needed to prevent regressionsNuisance ColumnsIdentifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.applyReduction Operationssum, mean, min, max, etc.good first issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions