Creating a Julia DataFrame with long ColumnName

Viewed 45

i am trying to create DataFrame in Julia using: df2 = DataFrame(A = 1:5)and its all right.

Now i want to create df = DataFrame("Amount") = 1:5) but it returns an error. I tried many thing and cant create a DataFrame with column names like "Amount", " Class Problem" etc..

How can i do it?

Thanks

1 Answers

Use => syntax instead, e.g.:

DataFrame("Amount" => 1:5, "Class Problem" => "const")
Related