A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.errors.SpecificationError.html below:

pandas.errors.SpecificationError — pandas 2.3.1 documentation

pandas.errors.SpecificationError#
exception pandas.errors.SpecificationError[source]#

Exception raised by agg when the functions are ill-specified.

The exception raised in two scenarios.

The first way is calling agg on a Dataframe or Series using a nested renamer (dict-of-dict).

The second way is calling agg on a Dataframe with duplicated functions names without assigning column name.

Examples

>>> df = pd.DataFrame({'A': [1, 1, 1, 2, 2],
...                    'B': range(5),
...                    'C': range(5)})
>>> df.groupby('A').B.agg({'foo': 'count'}) 
... # SpecificationError: nested renamer is not supported
>>> df.groupby('A').agg({'B': {'foo': ['sum', 'max']}}) 
... # SpecificationError: nested renamer is not supported
>>> df.groupby('A').agg(['min', 'min']) 
... # SpecificationError: nested renamer is not supported

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4