Noobie
Noobie

Reputation: 3

How do you know where a csv file is stored once you write a DataFrame onto disk?

     import pandas as pd
     hand_1=pd.DataFrame({
    'Tables of 5':[5,10,15,20,25],
    'Tables of 6':[6,12,18,24,30]})

     hand_1.to_csv('Tables.csv')`  

How do i find out where Tables.csv is stored?

Is this where python stores csv files by default and can this be changed?

Upvotes: 0

Views: 3535

Answers (1)

Baris
Baris

Reputation: 405

It will be saved in your current working directory. If you would like to learn it, you can use the following code:

import os
current_directory = os.getcwd() 

You can give a full path instead of tables.csv to store in another directory.

Upvotes: 2

Related Questions