Skip to content

Commit

Permalink
docs: add "returns" documentation to functions.py (narwhals-dev#1331)
Browse files Browse the repository at this point in the history
* add returns documentation

* add documentation to v1
  • Loading branch information
marenwestermann authored and MarcoGorelli committed Nov 7, 2024
1 parent 834bc4f commit 55d213c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions narwhals/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ def new_series(
may auto-infer it from `values`.
native_namespace: The native library to use for DataFrame creation.
Returns:
A new Series
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -291,6 +294,9 @@ def from_dict(
native_namespace: The native library to use for DataFrame creation. Only
necessary if inputs are not Narwhals Series.
Returns:
A new DataFrame
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -431,6 +437,9 @@ def from_arrow(
native_frame: Object which implements `__arrow_c_stream__`.
native_namespace: The native library to use for DataFrame creation.
Returns:
A new DataFrame
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down
9 changes: 9 additions & 0 deletions narwhals/stable/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2323,6 +2323,9 @@ def new_series(
may auto-infer it from `values`.
native_namespace: The native library to use for DataFrame creation.
Returns:
A new Series
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -2376,6 +2379,9 @@ def from_arrow(
native_frame: Object which implements `__arrow_c_stream__`.
native_namespace: The native library to use for DataFrame creation.
Returns:
A new DataFrame
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down Expand Up @@ -2431,6 +2437,9 @@ def from_dict(
native_namespace: The native library to use for DataFrame creation. Only
necessary if inputs are not Narwhals Series.
Returns:
A new DataFrame
Examples:
>>> import pandas as pd
>>> import polars as pl
Expand Down

0 comments on commit 55d213c

Please sign in to comment.