pandas.errors.SpecificationError#
- exception pandas.errors.SpecificationError[source]#
Exception raised by
aggwhen the functions are ill-specified.The exception raised in two scenarios.
The first way is calling
aggon a Dataframe or Series using a nested renamer (dict-of-dict).The second way is calling
aggon a Dataframe with duplicated functions names without assigning column name.See also
DataFrame.aggAggregate using one or more operations over the specified axis.
Series.aggAggregate using one or more operations over the specified axis.
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