Georgery
Georgery

Reputation: 8117

Problems loading CSV file in Julia

I'm trying to use the Queryverse to load a csv file, like this

using Queryverse

df = load("my_file.csv"
        , delim = ";"
        , row_estimate = 215_000
        , type_detect_rows = 2_000) |> 
    DataFrame

but I get the following error:

MethodError: no method matching UInt8(::String)

I'm sorry, I can't share an example of the file.

The error message is not very informative. I'm guessing there might be some problem with the type detection of the rows - that's why I played around with the with the function parameters, but it doesn't seem to work out.

Can anyone help?

Upvotes: 3

Views: 593

Answers (1)

Przemyslaw Szufel
Przemyslaw Szufel

Reputation: 42214

The problem with your code is the delim parameter that shoud be a Char not a String.

So this should be:

df = load("my_file.csv"
        , delim = ';'
        , row_estimate = 215_000
        , type_detect_rows = 2_000) |> 
    DataFrame

The error you got is related to processing the delimiter parameter not the data in your file!

Nevertheless, nornally the recommended option is to use CSV.jl for reading csv files rather than CSVFiles.jl that is used by Queryverse.load function.

Upvotes: 3

Related Questions