From 2e3b6f923fa2ea7739091a3ff0bb3dc637266db3 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang Date: Sun, 29 Dec 2024 15:00:10 +0800 Subject: [PATCH] docs: add return type descriptions for `cum_count`, `cum_max`, `cum_min`, `cum_prod`, `cum_sum` in Series --- narwhals/series.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/narwhals/series.py b/narwhals/series.py index bbf94f38a..228fb01c6 100644 --- a/narwhals/series.py +++ b/narwhals/series.py @@ -1394,6 +1394,9 @@ def cum_sum(self: Self, *, reverse: bool = False) -> Self: Arguments: reverse: reverse the operation + Returns: + A new Series with the cumulative sum of the values. + Examples: >>> import pandas as pd >>> import polars as pl @@ -3211,6 +3214,9 @@ def cum_count(self: Self, *, reverse: bool = False) -> Self: Arguments: reverse: reverse the operation + Returns: + A new Series with the cumulative count of non-null values. + Examples: >>> import narwhals as nw >>> from narwhals.typing import IntoSeriesT @@ -3264,6 +3270,9 @@ def cum_min(self: Self, *, reverse: bool = False) -> Self: Arguments: reverse: reverse the operation + Returns: + A new Series with the cumulative min of non-null values. + Examples: >>> import narwhals as nw >>> from narwhals.typing import IntoSeriesT @@ -3317,6 +3326,9 @@ def cum_max(self: Self, *, reverse: bool = False) -> Self: Arguments: reverse: reverse the operation + Returns: + A new Series with the cumulative max of non-null values. + Examples: >>> import narwhals as nw >>> from narwhals.typing import IntoSeriesT @@ -3370,6 +3382,9 @@ def cum_prod(self: Self, *, reverse: bool = False) -> Self: Arguments: reverse: reverse the operation + Returns: + A new Series with the cumulative product of non-null values. + Examples: >>> import narwhals as nw >>> from narwhals.typing import IntoSeriesT