Skip to content

Commit

Permalink
fix ewm.mean
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Sep 19, 2024
1 parent f910c09 commit 9b5f56a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/window/ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def _apply_agg_series(self, sr, agg_name):
# passing them in.
to_libcudf_column = sr._column.astype("float64").nans_to_nulls()

return self.obj._from_data_like_self(
self.obj._data._from_columns_like_self(
return sr._from_data_like_self(
sr._data._from_columns_like_self(
[
scan(
agg_name,
Expand Down
8 changes: 8 additions & 0 deletions python/cudf/cudf/tests/test_ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,11 @@ def test_ewma(data, params, adjust):
got = gsr.ewm(**params).mean()

assert_eq(expect, got)

gdf = cudf.DataFrame({"foo": data, "bar": data}, dtype="float64")
pdf = gdf.to_pandas()

expect = gdf.ewm(**params).mean()
got = pdf.ewm(**params).mean()

assert_eq(expect, got)

0 comments on commit 9b5f56a

Please sign in to comment.