Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bigframes/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def sum(self):

def mean(self):
return self._apply_aggregate(agg_ops.mean_op)

def median(self):
return self._apply_aggregate(agg_ops.median_op)

def var(self):
return self._apply_aggregate(agg_ops.var_op)
Expand Down
2 changes: 2 additions & 0 deletions tests/system/small/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def test_series_groupby_rolling_closed_param(rows_rolling_series, closed):
pytest.param(lambda x: x.min(), id="min"),
pytest.param(lambda x: x.max(), id="max"),
pytest.param(lambda x: x.mean(), id="mean"),
pytest.param(lambda x: x.median(), id="median"),
pytest.param(lambda x: x.count(), id="count"),
pytest.param(lambda x: x.std(), id="std"),
pytest.param(lambda x: x.var(), id="var"),
Expand Down Expand Up @@ -210,6 +211,7 @@ def test_series_window_agg_ops(rows_rolling_series, windowing, agg_op):
pytest.param(lambda x: x.min(), id="min"),
pytest.param(lambda x: x.max(), id="max"),
pytest.param(lambda x: x.mean(), id="mean"),
pytest.param(lambda x: x.median(), id="median"),
pytest.param(lambda x: x.count(), id="count"),
pytest.param(lambda x: x.std(), id="std"),
pytest.param(lambda x: x.var(), id="var"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def sum(self):
def mean(self):
"""Calculate the weighted window mean."""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def median(self):
"""Calculate the rolling median."""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

def var(self):
"""Calculate the weighted window variance."""
Expand Down
Loading