Convert Julia array to dataframe

前端 未结 4 381
遇见更好的自我
遇见更好的自我 2021-01-13 12:53

I have an array X that I\'d like to convert to a dataframe. Upon recommendation from the web, I tried converting to a dataframe and get the following error.

j

4条回答
  •  遥遥无期
    2021-01-13 13:17

    I've been confounded by the same issue a number of times, and eventually realized the issue is often related to the format of the array, and is easily resolved by simply transposing the array prior to conversion.

    In short, I recommend:

    julia> convert(DataFrame, x')
    

提交回复
热议问题