Skip to content

Commit

Permalink
Updated docstring for Series.max()
Browse files Browse the repository at this point in the history
  • Loading branch information
ugohuche committed May 8, 2024
1 parent 03dc05b commit 2ba173b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions narwhals/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,17 @@ def max(self) -> Any:
>>> s_pd = pd.Series(s)
>>> s_pl = pl.Series(s)
We define a data-frame agnostic function:
We define a library agnostic function:
>>> def func(s_any):
... s = nw.from_native(s_any, series_only=True)
... s = s.max()
... return nw.to_native(s)
... return s.max()
We can then pass either pandas or Polars to `func`:
>>> func(s_pd) # doctest:+SKIP
0 3
dtype: int64
>>> func(s_pl) # doctest:+SKIP
>>> func(s_pd)
3
>>> func(s_pl)
3
"""
return self._series.max()
Expand Down

0 comments on commit 2ba173b

Please sign in to comment.