I'm trying to implement a functionality converting longer columns to widers columns in pydatatable, in this process i have come across an issue with dictionary which has different sizes each key as demonstrated in the below code.
long_to_wide_dict = {
'eggs':[3,5,6,9],
'fruits':[1,2,3,4,5],
'chicken':[5,10,2],
'beef':[10,10],
'bread':[5,4,3,2,1]
}
I'm passing this dict to a Frame object as
dt.Frame(long_to_wide_dict)
Here its throwing out an error as
ValueError: Column 1 has different number of rows (5) than the preceding columns (4)
It's obvious that each key should have equal size of values when a data structure passed to Frame. So, is there any option avail like Force to fill in NA's to key which is having lesser values so that each key would come to equal sizes.
Would you have any other suggestions for it ?.