Skip to content

Commit

Permalink
added to pandaslikeexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
DeaMariaLeon committed Oct 31, 2024
1 parent a4b5bd7 commit 686e33c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions narwhals/_pandas_like/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,29 @@ def is_in(self, other: Any) -> Self:
def arg_true(self) -> Self:
return reuse_series_implementation(self, "arg_true")

def ewm_mean(
self,
*,
com: float | None = None,
span: float | None = None,
half_life: float | None = None,
alpha: float | None = None,
adjust: bool = True,
min_periods: int = 1,
ignore_nulls: bool = False,
) -> Self:
return reuse_series_implementation(
self,
"ewm_mean",
com=com,
span=span,
half_life=half_life,
alpha=alpha,
adjust=adjust,
min_periods=min_periods,
ignore_nulls=ignore_nulls,
)

def filter(self, *predicates: Any) -> Self:
plx = self.__narwhals_namespace__()
other = plx.all_horizontal(*predicates)
Expand Down
2 changes: 1 addition & 1 deletion narwhals/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def ewm_mean(
We can then pass either pandas or Polars to `func`:
>>> func(df_pd)
>>> func(df_pl) # doctest: +NORMALIZE_WHITESPACE
Expand Down

0 comments on commit 686e33c

Please sign in to comment.