import pandas as pd
data = pd.read_csv("/Users/dibaa/train.csv")
y = data['label']
data.drop('label',axis=1,inplace = True)
X = data
y = pd.Categorical(y)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/dibaa/train.csv'
import pandas as pd
data = pd.read_csv("/Users/dibaa/train.csv")
y = data['label']
data.drop('label',axis=1,inplace = True)
X = data
y = pd.Categorical(y)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/dibaa/train.csv'
By default pandas will look for the file from the directory you ran the script from. If the csv file is in the same directory then pd.read_csv('train.csv') should work. If not, you'll have to include the absolute path to it.