Skip to content

Commit

Permalink
docs[python]: Clarify polar.from_* clones data (#4524)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxiaof committed Aug 23, 2022
1 parent d05597e commit c30d9c0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions py-polars/polars/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def from_dict(
columns: Sequence[str] | None = None,
) -> DataFrame:
"""
Construct a DataFrame from a dictionary of sequences.
Construct a DataFrame from a dictionary of sequences. This operation clones data,
unless you pass in a `dict[str, pl.Series]`.
Parameters
----------
Expand Down Expand Up @@ -73,7 +74,7 @@ def from_dicts(
dicts: Sequence[dict[str, Any]], infer_schema_length: int | None = 50
) -> DataFrame:
"""
Construct a DataFrame from a sequence of dictionaries.
Construct a DataFrame from a sequence of dictionaries. This operation clones data.
Parameters
----------
Expand Down Expand Up @@ -116,7 +117,7 @@ def from_records(
infer_schema_length: int | None = 50,
) -> DataFrame:
"""
Construct a DataFrame from a sequence of sequences.
Construct a DataFrame from a sequence of sequences. This operation clones data.
Note that this is slower than creating from columnar memory.
Expand Down Expand Up @@ -169,7 +170,7 @@ def from_numpy(
orient: Orientation | None = None,
) -> DataFrame:
"""
Construct a DataFrame from a numpy ndarray.
Construct a DataFrame from a numpy ndarray. This operation clones data.
Note that this is slower than creating from columnar memory.
Expand Down Expand Up @@ -317,6 +318,7 @@ def from_pandas(
) -> DataFrame | Series:
"""
Construct a Polars DataFrame or Series from a pandas DataFrame or Series.
This operation clones data.
This requires that pandas and pyarrow are installed.
Expand Down

0 comments on commit c30d9c0

Please sign in to comment.