rows_by_key
works with pl.Array
#18813
Labels
enhancement
New feature or an improvement of an existing feature
rows_by_key
works with pl.Array
#18813
Description
I have this dataframe:
And I want to transform this dataframe into this dictionnary:
{(0,0): "a", (0, 1): "b"}
The way to do it would be to used
df.rows_by_key("a")
but it fails withTypeError: unhashable type: 'list'
This is because pl.Array becomes list python object and so cannot be key of a dictionary. But I would be great is pl.Array get transform in tuple.
I think it make a lot of sense overall and this way we can translate any polars dataframe to any builtin python type:
The text was updated successfully, but these errors were encountered: