Allow to use repeat_by
with lists
#21151
Labels
enhancement
New feature or an improvement of an existing feature
repeat_by
with lists
#21151
Description
Currently, trying to use
repeat_by
with a list dtype results in the following error:MWE:
Conceptually, I see no issue that this cannot be supported, lists can be repeated similarly to e.g. strings.
Happy to open a PR for this but I might need some guidance where to do this...
crates/polars-ops/src/chunked_array/repeat_by.rs
whereList
needs to be allowed as another dtypeListFromIter
incrates/polars-arrow/src/legacy/array/mod.rs
(e.g. with afrom_iter_list_trusted_len
method)?MutableListArray
seems to require concrete types and this is impossible as lists can be arbitrarily nestedThat being said, the functionality to do this should already be in polars.
group_by.agg
also allows to chain arbitrary lists.The text was updated successfully, but these errors were encountered: