FileNotFoundError while importing a csv file using pandas in Jupyter notebook

℡╲_俬逩灬. 提交于 2019-12-04 13:32:31

Change

pd.read_csv('\Users\user\Desktop\Workbook1.csv')

to

pd.read_csv(r'C:\Users\user\Desktop\Workbook1.csv')

Please try the following code:

import os  
path = os.path.abspath(r'file path')
f = open(path)
print(f)

The working directory is the point from where all the files are accessed in Jupyter Notebook.

Find the current working directory

import os

os.getcwd()

Example o/p : 'C:\Users\xyz'

Now place your CSV files in this path

List the contents of your directory to check if the CSV file is present

os.listdir('C:\Users\xyz')

Now try reading the CSV file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!