0

I have my CSV files in a Data Folder in Jupyter Notebook, then I have a few other notebooks that I want to rely on the CSV files in the Data Folder. How do I read in the CSV files From the Data Folder into the notebooks that I want the analysis to occur in? I'm using a Mac and doing this in Python.

0

1 Answer 1

1

You need to specify the path to the csv file you want to put in pd.read_csv. For example, if your jupyter notebook is located on your Desktop, and the csv file (lets call it "my_project_1") is somewhere else, say in a folder called Projects, and that folder is in your Documents folder, then you specify the path as following:

import pandas as pd

df = pd.read_csv('/Users/your_user_name/Documents/Projects/my_project_1.csv')

Don't forget to change your_user_name to your actual user name.

Sign up to request clarification or add additional context in comments.

1 Comment

is it for Linux only? Will it work with windows?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.