Home Tutorials How to Import and Use CSV file into Julia (Windows)

How to Import and Use CSV file into Julia (Windows)

In this short tutorial, we will learn how to import and use the CSV file into Julia on windows 10.

The first thing all you need to do is install Julia language and Jupyter notebook.

Once you complete the installation, then connect Julia to Jupyter notebook. So that Jupyter knows about Julia and you can run code on the notebook.

Now, we will show you how to import and use CSV file into Julia using the following platforms:

1. Julia Command Prompt

2. Jupyter Notebook

Method #1: Using Julia Command Prompt

Here, we will import CSV file using the Julia command prompt.

Follow the steps to import and use CSV file on your local machine.

Step #1: Open Command Prompt and Add Package

Open the Julia command prompt and install CSV package. In order to add CSV package, type the following commands at Julia command prompt then press Enter.

Intedrating CSV package into Julia
CSV Package Installation

You use Pkg for adding any packages. Since Pkg itself is a package so you have to import it through the using command.

This will download and install the CSV package along with its stuff.

Once you add the CSV package, you are now ready to import the dataset for wrangling, manipulation, and visualization.

Step #2: CSV Dataset Collection

In this tutorial, we will be using the iris flower dataset. Here, we downloaded and store the dataset on the desktop.

Below is an excerpt of iris dataset.

Iris dataset after importing and use in Julia on windows
Excerpt of Iris Dataset

Step #3: Import and Use the Dataset using CSV

Now, you type the following command along with its path name of your file.

It is worth mentioning that you use a double backslash within the path name instead of a single slash.

You should see a screenshot like this after reading the dataset.

Displaying iris dataset in Julia
Displaying Iris Dataset

Method #2: Using Jupyter Notebook IDE

Step #1: Open Jupyter Notebook and Add Package

First you launch the Jupyter notebook through the Anaconda navigator. After opening the notebook, you need to add CSV package.

Once you have installed the package then follow the below steps.

Step #2: Import and Use CSV file

In order to import the CSV dataset, we will use the commands in a notebook and then run the code.

After running, you will get the following output.

Import and use iris csv dataset in julia
Importing Iris Flower Data

Just keep in mind that you store the dataset and CSV package in the same folder to avoid the error.

No need to mention the path name in the source code as you can upload files directly in the working directory.

Hopefully this post was useful to you. Now, you can import and use CSV file into Julia on windows operating system.

Dr. Ujjal Marjit, PhDhttps://researcherssite.com
Dr. Ujjal Marjit leads the Centre for Information Resource Management of the University of Kalyani, India. He received his bachelor honours degree from Visva Bharati, Central University and Master in Computer Application from Jadavpur University, India.He did his BLISc and MLISc from Madurai Kamraj University, India. He obtained his PhD in Computer Science and Engineering from University of Kalyani. He was also a visiting researcher at Norwegian University of Science and Technology (NTNU), Norway. Dr. Marjit was a member of the Association for Computing Machinery (ACM), USA. He has coauthored several book chapters and over 70 research publications in various International Journals and Conferences. Dr. Marjit attended many national and international conferences in India and abroad ( Germany, London, Finland, Norway, Netherlands). He has been working in University since 2001.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

How to Summarize a Research Article (Academic)

In this blog post, we will show you how to summarize an academic research article with Scholarcy

How to Add Julia to Visual Studio Code Editor on Windows

How to Connect Julia to VS Code on Windows

How to Identify Relevant Academic Papers using Literature Discovery Tool

In this article, we will show you how to identify relevant academic papers using the literature discovery tool (Citation Gecko)

Best 5 Academic Search Engines for Research (Multidisciplinary)

In this post, we will go through the best 5 free multidisciplinary academic search engines for Research