Skip to content

Request: Better error message for missing columns in aggregate #32755

Closed
@tsoernes

Description

@tsoernes

When attempting to aggregate a non-existing column, this error is raised, which is not very descriptive: SpecificationError: nested renamer is not supported

In [39]: pd.DataFrame([[1, 2]], columns=['A', 'B']).groupby('A').agg({'B': 'mean'})
Out[39]: 
   B
A   
1  2

In [40]: pd.DataFrame([[1, 2]], columns=['A', 'B']).groupby('A').agg({'B': 'mean', 'non-existing': 'mean'})
Out[40]:
...
SpecificationError: nested renamer is not supported

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions