Код: Выделить всё
df = pl.from_repr("""
┌──────┬──────────┬──────────┬──────────┐
│ Year ┆ Product1 ┆ Product2 ┆ Product3 │
│ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ i64 ┆ i64 │
╞══════╪══════════╪══════════╪══════════╡
│ 2018 ┆ 100 ┆ 150 ┆ 200 │
│ 2019 ┆ 120 ┆ 180 ┆ 240 │
│ 2020 ┆ 140 ┆ 210 ┆ 280 │
└──────┴──────────┴──────────┴──────────┘
""")
Код: Выделить всё
shape: (3, 4)
┌──────────┬──────┬──────┬──────┐
│ ┆ 2018 ┆ 2019 ┆ 2020 │
│ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ i64 ┆ i64 ┆ i64 │
╞══════════╪══════╪══════╪══════╡
│ Product1 ┆ 100 ┆ 120 ┆ 140 │
│ Product2 ┆ 150 ┆ 180 ┆ 210 │
│ Product3 ┆ 200 ┆ 240 ┆ 280 │
└──────────┴──────┴──────┴──────┘
Подробнее здесь: https://stackoverflow.com/questions/777 ... -in-polars