Skip to content

Commit d78150b

Browse files
docs: add "returns" documentation to functions.py (#1331)
* add returns documentation * add documentation to v1
1 parent e16b032 commit d78150b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

narwhals/functions.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ def new_series(
173173
may auto-infer it from `values`.
174174
native_namespace: The native library to use for DataFrame creation.
175175
176+
Returns:
177+
A new Series
178+
176179
Examples:
177180
>>> import pandas as pd
178181
>>> import polars as pl
@@ -291,6 +294,9 @@ def from_dict(
291294
native_namespace: The native library to use for DataFrame creation. Only
292295
necessary if inputs are not Narwhals Series.
293296
297+
Returns:
298+
A new DataFrame
299+
294300
Examples:
295301
>>> import pandas as pd
296302
>>> import polars as pl
@@ -431,6 +437,9 @@ def from_arrow(
431437
native_frame: Object which implements `__arrow_c_stream__`.
432438
native_namespace: The native library to use for DataFrame creation.
433439
440+
Returns:
441+
A new DataFrame
442+
434443
Examples:
435444
>>> import pandas as pd
436445
>>> import polars as pl

narwhals/stable/v1/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,6 +2323,9 @@ def new_series(
23232323
may auto-infer it from `values`.
23242324
native_namespace: The native library to use for DataFrame creation.
23252325
2326+
Returns:
2327+
A new Series
2328+
23262329
Examples:
23272330
>>> import pandas as pd
23282331
>>> import polars as pl
@@ -2376,6 +2379,9 @@ def from_arrow(
23762379
native_frame: Object which implements `__arrow_c_stream__`.
23772380
native_namespace: The native library to use for DataFrame creation.
23782381
2382+
Returns:
2383+
A new DataFrame
2384+
23792385
Examples:
23802386
>>> import pandas as pd
23812387
>>> import polars as pl
@@ -2431,6 +2437,9 @@ def from_dict(
24312437
native_namespace: The native library to use for DataFrame creation. Only
24322438
necessary if inputs are not Narwhals Series.
24332439
2440+
Returns:
2441+
A new DataFrame
2442+
24342443
Examples:
24352444
>>> import pandas as pd
24362445
>>> import polars as pl

0 commit comments

Comments
 (0)