I tried to find a way to transform a column containing vectors (all of equal length) as values into columns per vector element.
df = DataFrame(data=rand(3), list_data=[[1, 2], [3, 4], [5, 6]]) transform(df, :list_data => (col -> [el for el in col]) => [:A,:B])
The above code works. However, I don’t have any clue why it is working? My understanding is that
col: represents column df.list_data which is of type
[el for el in col] also of type
typeof([el for el in df.list_data]) == typeof(df.list_data) returns true.
So why does the split into columns then work?
This may be a weird question but I want to understand the mechanics behind dataframes and julia.