Unable to load titanic dataset

import os

TITANIC_PATH = os.path.join(“datasets”, “titanic”)

import pandas as pd

def load_titanic_data(filename, titanic_path=TITANIC_PATH):
csv_path = os.path.join(titanic_path, filename)
return pd.read_csv(csv_path)

train_data = load_titanic_data(“train.csv”)
test_data = load_titanic_data(“test.csv”)
It is giving file not found error
I have upload the train and test csv files in ‘titanic’ folder in datasets but I am getting error.

Hi Soumyadeep,

Your code seems fine. Please make sure the files are unzipped and then stored in the folder. It should have two files, train.csv and test.csv

Regards

I have uploaded the files in datasets in folder titanic

Hi Soumyadeep,

Can you please share a screenshot of your home directory, where all your notebooks as well as the datasets folder is present?

Regards

Hi Soumyadeep,

Start a new notebook in your machine_learning folder and then try again. Tell me if it works…

Regards

yes it works but will it work in the right screen notebook

Hi Soumyadeep,

The path where your dataset is saved must be exact, only then the system will find it correctly. Yes, it will also work on the right hand screen if you assign the path correctly. Either ways, it solves your issue.

Happy Coding!

Regards

can you check my topic iris data set .Is it ok or not