I am using below dataframe to convert to dictionary in specific format.
However, I am getting an error TypeError: unhashable type: 'Series'
import polars as pl
#input (polars eager dataframe):
polar_df = pl.DataFrame(
"foo": ['a', 'b', 'c'],
"bar": [[6.0, 7.0, 8.0],[9.0,10.0,11.0],[12.0,13.0,14.0]]
)
#expected output (dictionary):
#{'a':[6.0, 7.0, 8.0],'b':[9.0,10.0,11.0],'c':[12.0,13.0,14.0]}
dict_output =
dict(zip(polar_df.select(pl.col('foo')),
polar_df.select(pl.col('bar'))
))