HarlanH/DataFrames.jl — pull request #83 by kmsquire (2012-11-29 09:53:59+00:00)
Title: RFC: Added constructor for DataFrame from a Vector of Associative objects

(aka a list of dictionaries)

In Pandas, I frequently create data on the fly using a list of dictionaries, which I then turn into a DataFrame. This method allows that type of DataFrame creation.

```julia
julia> load("DataFrames")

julia> using DataFrames

julia> aa = [{"a"=>1, "b"=>'c'}, {"a"=>3, "b"=>'d'}, {"a"=>5}]
3-element Dict{Any,Any} Array:
{"a"=>1,"b"=>'c'}
{"a"=>3,"b"=>'d'}
{"a"=>5}

julia> df = DataFrame(aa)
DataFrame (3,2)
a b
[1,] 1 'c'
[2,] 3 'd'
[3,] 5 NA

julia> df["a"]
3-element Int64 Array:
1
3
5

julia> df["b"]
3-element Union(NAtype,Char) Array:
'c'
'd'
NA
```

It seems to work, but since I don't know the DataFrames.jl code base that well, I might have made some incorrect assumptions. In particular, I assign NA values up front for missing values--is this okay?

Feedback appreciated.

Cheers!

Kevin