File b'train.csv' does not exist even though file exist

  1. Are you sure you have the correct path?

train_df = pd.read_csv("./input/train.csv") (if the csv file is in the input folder which is in the same folder as your jupyter notebook)

Easiest would be you have a folder which contains the juptyer notebook and the csv file. Then you would just need to do:

train_df = pd.read_csv("./train.csv") or train_df = pd.read_csv("train.csv")

  1. Try using train_df = pd.read_csv("train.csv",encoding='utf-8' )

to get rid of the 'b in front of b'../input/train.csv'


Try using an absolute path like this. The r at the beginning of the line helps to read the whole string as a raw string as it is, so when r is used, you don't have to worry about escaping slashes

import pandas

myFile = pandas.read_csv(r"C:\Users\samarnat\Documents\Personal Docs\Projects\train.csv",encoding='utf-8')

Possible Reasons:

  1. Path entered is incorrect or multiple folders of same name.
  2. The name of the file is incorrect.
  3. The file extension is not csv, it maybe xlsx (Rare chance)

Hope this helps.