Open Julian-J-S opened 1 month ago
would changing return type of splitn / split_exact to Array allow the following?
.with_columns(pl.all().str.split_exact('=', 1).list.get(1))
I am facing issue like this one Convert struct to list.
@justcodingandy You can extract struct fields by index.
>>> pl.select(pl.lit('foo=bar').str.split_exact('=', 1).struct[1])
shape: (1, 1)
┌─────────┐
│ field_1 │
│ --- │
│ str │
╞═════════╡
│ bar │
└─────────┘
Description
I wanted to bring this back once more before "locking in the API" with V1.0 (see also #11640, #13649)
Example
Problems
splitn
andsplit_exact
have same signature but parameters behave different (confusing!) (explained in detail here #11640)splitn
andsplit_exact
should probably return anArray
which is more appropriate for same type fixed list with unknown namessplitn
should probably be calledsplit_n
according to polars converntionSuggested Improvement
splitn
andsplit_exact
(more detailed suggestion here #11640 or #13649)splitn
/split_exact
toArray