Where does my file go when running a to_csv in the Notebook?

Completed

Comments

2 comments

  • Avatar
    Mahesh Shenoy

    Sarath Botlagunta / Pradeepraj Chandrasekaran 

    0
    Comment actions Permalink
  • Avatar
    Labinot Dvorani

    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)
    0
    Comment actions Permalink

Please sign in to leave a comment.