Search code examples
julialighttable

no method error using Datavector at LightTable Julia0.3


LiteTable 0.6.7 Julia 0.3 Jewel0.6.4 June 0.2 Mac OSX 10.9

Hi,I have a problem at using Datavector by DataFrame package.

using DataFrames
df = DataFrame()
df["Name"] = DataVector["JohnSmith", "JaneDoe"]
df["Height"] = DataVector[73.0,68.0]
df["Weight"] = DataVector[NA,130]
df["Gender"] = DataVector["Male","Female"]

after that, julia says

no method convert(Type{DataArray{T,1}}, ASCIIString)
in getindex at array.jl:121

I could do this same script at julia 0.2 Does LightTable's plugin such as Jewel,June not accept this DataFrames function?

I tried dataeye() and other function ,but this doesn't work..

Brw, I found a similar post at google group. https://groups.google.com/forum/#!topic/julia-users/VmgmRnBCo9I

Thanks for reading.


Solution

  • It looks like you're reading very old documentation for DataArrays and DataFrames. You might want to look at more recent docs: http://juliastats.github.io/DataFrames.jl/

    Here's how'd you do what you're trying to do:

    using DataFrames
    df = DataFrame()
    df[:Name] = @data(["JohnSmith", "JaneDoe"])
    df[:Height] = @data([73.0,68.0])
    df[:Weight] = @data([NA,130])
    df[:Gender] = @data(["Male","Female"])