logo

How to Read *.csv Files in Julia 📂Julia

How to Read *.csv Files in Julia

Guide

Old Version

  • In julia v1.5.0, *.csv files were read as follows:

5FD2EB031

In fact, Julia is not yet a language notably convenient for data input. However, if one desires speed, there may come a time when Julia should be chosen over Python, R, or Matlab. For instance, if one wants to load a *.csv file located just under the E drive, it can be entered as follows.

using CSV
data = CSV.read("E:/example.csv")

The execution result shows that the *.csv file has been successfully read into a dataframe.

5FD2EC7B1

New Version

  • Although the exact time is unknown, after julia v1.7.0, dataframes must be loaded separately as follows.
using CSV, DataFrames
data = CSV.read("E:/example.csv", DataFrame)

Environment

  • OS: Windows