cudf.core.groupby.groupby.GroupBy.diff#

GroupBy.diff(periods=1, axis=0)[source]#

Get the difference between the values in each group.

Parameters:
periodsint, default 1

Periods to shift for calculating difference, accepts negative values.

axis{0 or ‘index’, 1 or ‘columns’}, default 0

Take difference over rows (0) or columns (1). Only row-wise (0) shift is supported.

Returns:
Series or DataFrame

First differences of the Series or DataFrame.