pandas.errors.UnsupportedFunctionCall #

异常 pandas.errors。不支持的FunctionCall [来源] #

尝试调用不受支持的 numpy 函数时引发异常。

例如,np.cumsum(groupby_object)

例子

>>> df = pd.DataFrame({"A": [0, 0, 1, 1],
...                    "B": ["x", "x", "z", "y"],
...                    "C": [1, 2, 3, 4]}
...                   )
>>> np.cumsum(df.groupby(["A"]))
Traceback (most recent call last):
UnsupportedFunctionCall: numpy operations are not valid with groupby.
Use .groupby(...).cumsum() instead