What is the best way to read a CSV file

,

Hello there!

My question is, I have a dataset in a csv file and I would like to know what is the best way to load it in memory.
As an example, lets say I have the following columns:

time -> datetime
mag_field -> float
mot -> boolean

I know I could easily use

using DataFrames
using CSV

file = "data.csv"
my_data = CSV.File(file)

But what is the best way to, for example, when importing, letting CSV.File know what are the data types inside my file, get the column names properly.

You’re in luck, the CSV docs have just been rewritten! Please head over here to have all your questions (and more!) answered:

https://csv.juliadata.org/stable/reading.html#types

4 Likes