Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.errors.SpecificationError#

exceptionpandas.errors.SpecificationError[source]#

Exception raised byagg when the functions are ill-specified.

The exception raised in two scenarios.

The first way is callingagg on aDataframe or Series using a nested renamer (dict-of-dict).

The second way is callingagg on a Dataframe with duplicated functionsnames 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

[8]ページ先頭

©2009-2025 Movatter.jp