Код: Выделить всё
df = pl.from_repr("""
┌─────┬─────────┬──────────┬──────────────┬───────────────┐
│ id ┆ age_pre ┆ age_post ┆ exposure_pre ┆ exposure_post │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ i64 ┆ f64 ┆ f64 │
╞═════╪═════════╪══════════╪══════════════╪═══════════════╡
│ 123 ┆ 55 ┆ 56 ┆ 0.49 ┆ 0.51 │
│ 123 ┆ 56 ┆ 57 ┆ 0.49 ┆ 0.51 │
│ 456 ┆ 49 ┆ 50 ┆ 0.8 ┆ 0.2 │
│ 456 ┆ 50 ┆ 51 ┆ 0.8 ┆ 0.2 │
└─────┴─────────┴──────────┴──────────────┴───────────────┘
""")
Код: Выделить всё
shape: (8, 3)
┌─────┬─────┬──────────┐
│ id ┆ age ┆ exposure │
│ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ f64 │
╞═════╪═════╪══════════╡
│ 123 ┆ 55 ┆ 0.49 │
│ 123 ┆ 56 ┆ 0.51 │
│ 123 ┆ 56 ┆ 0.49 │
│ 123 ┆ 57 ┆ 0.51 │
│ 456 ┆ 49 ┆ 0.8 │
│ 456 ┆ 50 ┆ 0.2 │
│ 456 ┆ 50 ┆ 0.8 │
│ 456 ┆ 51 ┆ 0.2 │
└─────┴─────┴──────────┘
Подробнее здесь: https://stackoverflow.com/questions/757 ... ulting-val