Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add return type descriptions to Series arg_true, cast, clip, count #1667

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading