Skip to content

Commit

Permalink
docs: highlight differences in median impl across backends
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroMiola committed Oct 25, 2024
1 parent 80ecc0f commit a6b4089
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions narwhals/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ def median(self) -> Self:
"""
Get median value.
Notes:
Results might slightly differ across backends due to differences in the underlying algorithms used to compute the median.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -4595,8 +4598,9 @@ def median(*columns: str) -> Expr:
"""
Get the median value.
Note:
Syntactic sugar for ``nw.col(columns).median()``
Notes:
- Syntactic sugar for ``nw.col(columns).median()``
- Results might slightly differ across backends due to differences in the underlying algorithms used to compute the median.
Arguments:
columns: Name(s) of the columns to use in the aggregation function
Expand Down
3 changes: 3 additions & 0 deletions narwhals/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ def median(self) -> Any:
"""
Reduce this Series to the median value.
Notes:
Results might slightly differ across backends due to differences in the underlying algorithms used to compute the median.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down
5 changes: 3 additions & 2 deletions narwhals/stable/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1361,8 +1361,9 @@ def median(*columns: str) -> Expr:
"""
Get the median value.
Note:
Syntactic sugar for ``nw.col(columns).median()``
Notes:
- Syntactic sugar for ``nw.col(columns).median()``
- Results might slightly differ across backends due to differences in the underlying algorithms used to compute the median.
Arguments:
columns: Name(s) of the columns to use in the aggregation function
Expand Down

0 comments on commit a6b4089

Please sign in to comment.