polars/polars-pandas-round-trip
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| Polars | info | unsafe, with xpd check --fix --unsafe-fixes |
All versions |
A Polars to pandas to Polars round trip converts the data twice. Keep the original frame when no pandas operation is needed.
pl.from_pandas(df.to_pandas())dfWhat the rule reports
Section titled “What the rule reports”The integer-only round trip matched the original frame on 50,000 and 500,000 rows.
How to fix it
Section titled “How to fix it”Use xpd check --fix --unsafe-fixes to remove the pl.from_pandas(df.to_pandas()) round trip.
Diagnostic message
Section titled “Diagnostic message”A Polars to pandas to Polars round trip converts the data twice. Keep the original frame when no pandas operation is needed.See all rules in the Polars pack.