On Wednesday, October 15, 2014 1:09:01 AM UTC+2, James Kyle wrote:
> So I tried:
>
> convert(DataFrame, dict_data)
>
> This returns
>
> ERROR: ArgumentError("All columns in Dict must have the same length")
> in convert at
> /Users/jkyle/.julia/v0.3/DataFrames/src/dataframe/dataframe.jl:1001
I had this same problem just now. The problem is that you (and I!) have string
values in the dictionary. The convert function looks at the length of the
strings and see a vector of characters, and these are not conformable to the
unit-length values in the non-string entries.
My workaround was creating the dataframe from a dictionary where all the
strings had been cut to a single character. When the dataframe is created, I
could update the values with the actual (and longer) string values. Not
beautiful, but it works for now.
One of the motivations creating the dataframe from a dict is that the set of
columns is not always known, it would be useful if the convert function could
allow for string-values. Are there experts who know if this would be possible?
Best regards,
Erik Ø. Sørensen.