How can I convert df1
to df2
:
julia> df1 = DataFrame(:name => ["a", "b", "c", "c", "a", "b"], :count => [1,4,3,6,3,7], :time => [1,1,1,2,2,2])
6×3 DataFrame
Row │ name count time
│ String Int64 Int64
─────┼──────────────────────
1 │ a 1 1
2 │ b 4 1
3 │ c 3 1
4 │ c 6 2
5 │ a 3 2
6 │ b 7 2
julia> df2= DataFrame(:a => [1, 3], :b=> [4, 7], :c => [3, 6], time => [1,2])
2×4 DataFrame
Row │ a b c time
│ Int64 Int64 Int64 Int64
─────┼────────────────────────────
1 │ 1 4 3 1
2 │ 3 7 6 2