Skip to content

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())
df

The integer-only round trip matched the original frame on 50,000 and 500,000 rows.

Use xpd check --fix --unsafe-fixes to remove the pl.from_pandas(df.to_pandas()) round trip.

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.