Skip to content

polars/polars-dataframe-orient

Rule polars-dataframe-orient
Pack Polars
Severity info
Fix none, edit by hand
Library versions every version

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.

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

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

Browse the other rules of the Polars pack.