Код: Выделить всё
import polars as pl
pl.DataFrame(pl.Series("x", ["1, 0", "2,3", "5 4"])).with_columns(
pl.col("x").str.split(",").list.eval(pl.element().str.split(" "))
)
Код: Выделить всё
shape: (3, 1)
┌────────────────────┐
│ x │
│ --- │
│ list[list[str]] │
╞════════════════════╡
│ [["1"], ["", "0"]] │
│ [["2"], ["3"]] │
│ [["5", "4"]] │
└────────────────────┘
Подробнее здесь: https://stackoverflow.com/questions/791 ... at-it-is-a