bigframes.pandas.api.typing.Window.agg#
- Window.agg(func) df.DataFrame | series.Series[source]#
Aggregate using one or more operations over the specified axis.
Examples:
>>> import bigframes.pandas as bpd
>>> df = bpd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6], "C": [7, 8, 9]}) >>> df A B C 0 1 4 7 1 2 5 8 2 3 6 9 [3 rows x 3 columns]
>>> df.rolling(2).sum() A B C 0 <NA> <NA> <NA> 1 3 9 15 2 5 11 17 [3 rows x 3 columns]
>>> df.rolling(2).agg({"A": "sum", "B": "min"}) A B 0 <NA> <NA> 1 3 4 2 5 5 [3 rows x 2 columns]