-1

I have a train.csv file sitting on my Desktop that I want to import into my Jupyter notebook.

The file is located at the following place:

I tried the following Python code:

import pandas as pd
df_train = pd.read_csv('C:\home\name\Desktop\train.csv')

But I got the following error:

FileNotFoundError: [Errno 2] File b'C:\home\pinzhi\Desktop\train.csv' does not exist: b'C:\home\pinzhi\Desktop\train.csv'

What am I doing wrong?

PineNuts0
  • 4,740
  • 21
  • 67
  • 112

1 Answers1

0

You should use...

df_train = pd.read_csv('/home/pinzhi/Desktop/train.csv')

if you are using linux you must use path of linux.

ansev
  • 30,322
  • 5
  • 17
  • 31