Skip to content

polars/polars-dataframe-orient

Pack Severity Fix Versions
Polars info none, edit by hand All versions

Nested list data can fit both DataFrame orientations. Set orient explicitly so the values land in the intended columns.

pl.DataFrame([[1, 2], [3, 4]], schema=["x", "y"])
pl.DataFrame([[1, 2], [3, 4]], schema=["x", "y"], orient="row")

Inferred first row (1, 3). Explicit row orientation gave (1, 2).

Edit the code using the replacement in the example.

Nested list data can fit both DataFrame orientations. Set orient explicitly so the values land in the intended columns.

See all rules in the Polars pack.