Where does my file go when running a to_csv in the Notebook?
CompletedHello,
I am playing around with the Jupyter Notebook and am curious on where the csv file is getting generated when I write 'df.to_csv('filename.csv')'
Notebook is located here
Thanks!
-
Hi Steve,
If you haven't specified a full path for the CSV file, the file will be saved in the same directory where your Jupyter Notebook is located. You can check the current working directory using the following code snippet (Python):
import os
current_directory = os.getcwd()
print("Current working directory:", current_directory)to save to a specific location do the following:
df.to_csv('/path/to/your/directory/your_file.csv', index=False)
Please sign in to leave a comment.
Comments
2 comments