Unstack dataframe with combine by the same date

What is the simplest way to unstack the following dataframe

df = DataFrame(date=[Date(2018,1,1), Date(2018,1,1), Date(2018,1,1), Date(2018,1,2), Date(2018,1,2), Date(2018,1,2)], B=[“T1”, “T2”, “T3”, “T1”, “T2”, “T3”], value=1:6)

image

and get such dataframe

image

Thank you for answering.

unstack(df, :date, :B, :value)

should do the trick.

1 Like