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")What the rule reports
Section titled “What the rule reports”Inferred first row (1, 3). Explicit row orientation gave (1, 2).
How to fix it
Section titled “How to fix it”Edit the code using the replacement in the example.
Message
Section titled “Message”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.