This is actually broken right now.

One way to do this is found in the pull request here: 
https://github.com/JuliaStats/DataFrames.jl/pull/632/files

But we should probably follow Simon's suggestion in that thread and change the 
definition of convert to apply to AbstractMatrix.

 -- John

On Oct 29, 2014, at 9:11 AM, Bradley Setzler <bradley.setz...@gmail.com> wrote:

> Hi guys,
> 
> I see that the command has changed to convert a DataArray into a DataFrame, 
> so that I can then writetable and keep the data from the DataArray. The 
> following used to work, but now flattens the array so that the DataFrame has 
> only one column, regardless of the columns in the DataArray:
> 
> a=DataArray([1. 2; 3 4]) 
> 2x2 DataArray{Float64,2}: 
> 1.0 2.0 
> 3.0 4.0
> 
> b = DataFrame(a)
> 4x1 DataFrame 
> |-------|-----| 
> | Row # | x1 | 
> | 1 | 1.0 | 
> | 2 | 3.0 | 
> | 3 | 2.0 | 
> | 4 | 4.0 |
> 
> In this example, I do not want a 4x1 DataFrame, I want the DataFrame to be 
> the same size as the DataArray. How can I do this in the current version?
> 
> Thanks,
> Bradley

Reply via email to