Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems loading CSV file in Julia

Tags:

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?

like image 477
Georgery Avatar asked Feb 24 '26 22:02

Georgery


1 Answers

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.

like image 177
Przemyslaw Szufel Avatar answered Feb 27 '26 03:02

Przemyslaw Szufel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!