CSV.read provide a valid sink error

I tried to read local csv files in julialang. To do so, I did the following from julia terminal (windows):

using CSV
df = CSV.read("C:\\Users\\adam\\data-example\\glass.csv")

but I got following error:

ERROR: ArgumentError: provide a valid sink argument, like using DataFrames; CSV.read(source, DataFrame)
Stacktrace:
[1] read(::String, ::Nothing; copycols::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\adam.julia\packages\CSV\la2cd\src\CSV.jl:43
[2] read(::String, ::Nothing) at C:\Users\adam.julia\packages\CSV\la2cd\src\CSV.jl:42 (repeats 2 times)
[3] top-level scope at REPL[18]:1

how should I read simple .csv file julia? Plus, I am wondering is there any IDE for julialang, like jupyter notebook for python or google colab that support julia? Can anyone point me out any idea for reading .csv?

first, have you tried doing what the error msg suggests?


also please read the documentation:

CSV.File(path)

see also:

1 Like

The error message gives you the solution. You want

using CSV, DataFrames
df = CSV.read("C:\\Users\\adam\\data-example\\glass.csv", DataFrame)
1 Like

Thanks, this worked.

I am curious is there any IDE like jupyter notebook like IDE for experimenting julia code? is there anything similar to jupyter notebook for python? Any idea?

Ju in Jupyter stands for Julia. Checkout IJulia.jl.

Also, Pluto.jl is a good alternative.

If you’re look for real IDE, people use VC Code seems to be happy

2 Likes

could you share link or command I could install it from julia command line? like what we did for in python, pip install jupyter. Anything like that for julialang? Thanks!

did you read Julia manual by any chance?
https://docs.julialang.org/en/v1/stdlib/Pkg/

yes, I did but not mentioned about IJulia.jl. Currently, I am doing simple julia coding from julia terminal. I bet there must be other cool IDE like jupyter notebook for python. I am sorry if I miss your point.

All you need to do to instiall IJulia is do ] add IJulia. The docs show you how to add packages. IJulia is a package just like everything else

1 Like
2 Likes