From 82ab5fbfc948c51f0d1cf2cd03fa7ea241f6ed16 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Mon, 23 Dec 2024 19:48:07 +0800 Subject: [PATCH] docs: Add return descriptions to Series's `abs`, `alias`, `all`, `any` methods for clarity (#1653) docs: Add return descriptions to Series `abs`, `alias`, `all`, 'any' methods for clarity --- narwhals/series.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/narwhals/series.py b/narwhals/series.py index f37943969..37d6b29db 100644 --- a/narwhals/series.py +++ b/narwhals/series.py @@ -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 @@ -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 @@ -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 @@ -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