Skip to main content
`Ctrl`+`K`

# pandas.api.typing.Resampler.transform

final Resampler.transform(arg, *args, **kwargs)

  Call function producing a like-indexed Series on each group.

  Return a Series with the transformed values.

  Parameters:
    arg function

      To apply to each group. Should return a Series with the same index.

    *args, **kwargs

      Additional arguments and keywords.

  Returns:
    Series

      A Series with the transformed values, maintaining the same index as the original object.

  See also

  `core.resample.Resampler.apply`

    Apply a function along each group.

  `core.resample.Resampler.aggregate`

    Aggregate using one or more operations over the specified axis.

  Examples

      >>> s = pd.Series([1, 2], index=pd.date_range("20180101", periods=2, freq="1h"))
      >>> s
      2018-01-01 00:00:00    1
      2018-01-01 01:00:00    2
      Freq: h, dtype: int64

      >>> resampled = s.resample("15min")
      >>> resampled.transform(lambda x: (x - x.mean()) / x.std())
      2018-01-01 00:00:00   NaN
      2018-01-01 01:00:00   NaN
      Freq: h, dtype: float64