Skip to content

Commit

Permalink
docs: add return type descriptions to Series arg_true, cast, `cli…
Browse files Browse the repository at this point in the history
…p`, `count` (#1667)
  • Loading branch information
luke396 authored Dec 28, 2024
1 parent a4fbcb4 commit 4a9c8c7
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 @@ -598,6 +598,9 @@ def cast(self: Self, dtype: DType | type[DType]) -> Self:
Arguments:
dtype: Data type that the object will be cast into.
Returns:
A new Series with the specified data type.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -812,6 +815,9 @@ def skew(self: Self) -> Any:
def count(self) -> Any:
"""Returns the number of non-null elements in the Series.
Returns:
The number of non-null elements in the Series.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -1117,6 +1123,9 @@ def clip(
lower_bound: Lower bound value.
upper_bound: Upper bound value.
Returns:
A new Series with values clipped to the specified bounds.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -1252,6 +1261,9 @@ def is_in(self, other: Any) -> Self:
def arg_true(self) -> Self:
"""Find elements where boolean Series is True.
Returns:
A new Series with the indices of elements that are True.
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down

0 comments on commit 4a9c8c7

Please sign in to comment.