Add pl.concat_arr
: similar to pl.concat_list
but returns an array data type
#13846
Labels
A-dtype
Area: data types in general
A-dtype-list/array
Area: list/array data type
enhancement
New feature or an improvement of an existing feature
Description
Since the creation of the
pl.Array
data type it is a good way to approach "list" columns where all the lists have equal lenghts.The most common way I see this happening is when one does a
pl.concat_list('col_1', 'col_2', ..., 'col_n')
to get an column where all lists have n elements.One can do
pl.concat_list('col_1', 'col_2', ..., 'col_n').list.to_array(width=n)
but that requires knowledge of n (which might be dynamic when using selectors instead of explicit column names)Moreover, the list format is (probably) not as optimized as the array format for this usecase.
So... how about a
pl.concat_arr
(orpl.concat_array
) to leverage these benefits?The text was updated successfully, but these errors were encountered: