Skip to content

Commit

Permalink
docs: Add return descriptions to Series's abs, alias, all, `any…
Browse files Browse the repository at this point in the history
…` methods for clarity (#1653)

docs: Add return descriptions to Series `abs`, `alias`, `all`, 'any' methods for clarity
  • Loading branch information
luke396 authored Dec 23, 2024
1 parent fdf7ec8 commit 82ab5fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions narwhals/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ def any(self) -> Any:
Notes:
Only works on Series of data type Boolean.
Returns:
A boolean indicating if any values in the Series are True.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -870,6 +873,9 @@ def any(self) -> Any:
def all(self) -> Any:
"""Return whether all values in the Series are True.
Returns:
A boolean indicating if all values in the Series are True.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -1334,6 +1340,9 @@ def drop_nulls(self) -> Self:
def abs(self) -> Self:
"""Calculate the absolute value of each element.
Returns:
A new Series with the absolute values of the original elements.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -1631,6 +1640,9 @@ def alias(self, name: str) -> Self:
Arguments:
name: The new name.
Returns:
A new Series with the updated name.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down

0 comments on commit 82ab5fb

Please sign in to comment.