Exporting Data from google colab to local machine

Pranathi picture Pranathi · Mar 20, 2018 · Viewed 55.3k times · Source

How to export data frames which are created in google colab to your local machine?

I have cleaned a data set on google colab. Now I want to export the data frame to my local machine. df.to_csv is saving file to the virtual machine and not my local machine.

Answer

korakot picture korakot · Mar 21, 2018

Try this

from google.colab import files
files.download("data.csv")

Update(Sep 2018): now it's even easier

  • open the left pane
  • select 'Files' tab
  • click 'Refresh'
  • right click the file, then download

Update (Jan 2020): the UI changes

  • click on the folder icon on the left pane (3rd icon)
  • click 'Refresh'
  • right click the file, then download