Skip to content

Commit 7a39d1e

Browse files
authored
docs: Correct note in from_pandas about data being cloned (#23552)
1 parent 53913e0 commit 7a39d1e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

py-polars/polars/convert/general.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,12 @@ def from_pandas(
628628
"""
629629
Construct a Polars DataFrame or Series from a pandas DataFrame, Series, or Index.
630630
631-
This operation clones data.
631+
This operation may clone data. If you want to ensure that in-place modifications
632+
of the output don't affect the input, you may want to consider one of the following:
633+
634+
- Enable `Copy-On-Write <https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`_
635+
in pandas.
636+
- Call :meth:`DataFrame.clone` on the output of `from_pandas`.
632637
633638
This requires that :mod:`pandas` and :mod:`pyarrow` are installed.
634639

0 commit comments

Comments
 (0)