Skip to main content
`Ctrl`+`K`

# pandas.errors.UnsupportedFunctionCall

exception pandas.errors.UnsupportedFunctionCall

  Exception raised when attempting to call a unsupported numpy function.

  For example, `np.cumsum(groupby_object)`.

  See also

  `DataFrame.groupby`

    Group DataFrame using a mapper or by a Series of columns.

  `Series.groupby`

    Group Series using a mapper or by a Series of columns.

  `core.groupby.GroupBy.cumsum`

    Compute cumulative sum for each group.

  Examples

      >>> 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