close

How to load CSV file in Jupyter Notebook?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to load CSV file in Jupyter Notebook in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to load CSV file in Jupyter Notebook?

  1. How to load CSV file in Jupyter Notebook?

    Try this student_data = pd.read_csv("C:/Users/xxxx/Desktop/student-intervention- system/student-data.csv").

  2. load CSV file in Jupyter Notebook

    Try this student_data = pd.read_csv("C:/Users/xxxx/Desktop/student-intervention- system/student-data.csv").

Method 1

Use raw string notation for your Windows path. In python ‘\’ have meaning in python. Try instead do string like this r”path”:

student_data = pd.read_csv(r"C:\Users\xxxx\Desktop\student-intervention- system\student-data.csv")

If it doesnt work try this way:

import os

path = os.path.join('c:' + os.sep, 'Users', 'xxxx', 'Desktop', 'student-intervention-system', 'student-data.csv')
student_data = pd.read_csv(path)

Method 2

Try this student_data = pd.read_csv("C:/Users/xxxx/Desktop/student-intervention- system/student-data.csv").

Replacing backslashes in that code it will work for you.

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read