Skip to content

Commit

Permalink
fixed mkdocs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DeaMariaLeon committed Nov 3, 2024
1 parent 0cdb0c3 commit 73cc573
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
56 changes: 28 additions & 28 deletions narwhals/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,36 +485,36 @@ def ewm_mean(
│ 2.428571 │
└──────────┘
pandas and Polars handle nulls differently. So, When calculating ewm over
a sequence with null values, leading to distinct results:
pandas and Polars handle nulls differently. So, calculating ewm over
a sequence with null values leads to distinct results:
>>> data = {"a": [2.0, 4.0, None, 3.0, float("nan"), 3.0]}
>>> df_pd2 = pd.DataFrame(data)
>>> df_pl2 = pl.DataFrame(data)
>>> data = {"a": [2.0, 4.0, None, 3.0, float("nan"), 3.0]}
>>> df_pd2 = pd.DataFrame(data)
>>> df_pl2 = pl.DataFrame(data)
>>> func(df_pd2)
a
0 2.000000
1 3.333333
2 3.333333
3 3.090909
4 3.090909
5 3.023256
>>> func(df_pl2) # doctest: +NORMALIZE_WHITESPACE
shape: (6, 1)
┌──────────┐
│ a │
│ --- │
│ f64 │
╞══════════╡
│ 2.0 │
│ 3.333333 │
│ null │
│ 3.090909 │
│ NaN │
│ NaN │
└──────────┘
>>> func(df_pd2)
a
0 2.000000
1 3.333333
2 3.333333
3 3.090909
4 3.090909
5 3.023256
>>> func(df_pl2) # doctest: +NORMALIZE_WHITESPACE
shape: (6, 1)
┌──────────┐
│ a │
│ --- │
│ f64 │
╞══════════╡
│ 2.0 │
│ 3.333333 │
│ null │
│ 3.090909 │
│ NaN │
│ NaN │
└──────────┘
"""
return self.__class__(
lambda plx: self._call(plx).ewm_mean(
Expand Down
4 changes: 2 additions & 2 deletions narwhals/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ def ewm_mean(
2.428571
]
pandas and Polars handle nulls differently. So, When calculating ewm over
a sequence with null values, leading to distinct results:
pandas and Polars handle nulls differently. So, calculating ewm over
a sequence with null values leads to distinct results:
>>> data = [2.0, 4.0, None, 3.0, float("nan"), 3.0]
>>> s_pd2 = pd.Series(name="a", data=data)
Expand Down

0 comments on commit 73cc573

Please sign in to comment.