snowflake.snowpark.modin.plugin.extensions.groupby_overrides.SeriesGroupBy.pct_change¶
- SeriesGroupBy.pct_change(periods=1, fill_method=_NoDefault.no_default, limit=_NoDefault.no_default, freq=_NoDefault.no_default, axis=_NoDefault.no_default, **kwargs)[source]¶
Calculate pct_change of each value to previous entry in group.
- Parameters:
periods (int, default 1) – Periods to shift for forming percent change.
fill_method ({"bfill", "ffill", "pad"}, default "ffill") –
How to handle NAs before computing percent changes.
Deprecated since version 2.1.0: All options of fill_method are deprecated except fill_method=None.
limit (int, optional) –
The number of consecutive NAs to fill before stopping. Snowpark pandas does not yet support this parameter.
Deprecated since version 2.1.0.
freq (DateOffset, timedelta, or str, optional) – Increment to use from time series API (e.g. ‘ME’ or BDay()). Snowpark pandas does not yet support this parameter.
- Returns:
Percentage changes within each group.
- Return type:
Series or
DataFrame
Notes
This function ignores the as_index, sort, group_keys, and dropna arguments passed to the initial groupby call.
Examples
For SeriesGroupBy:
For DataFrameGroupBy: