Exporting Data from google colab to local machine Exporting Data from google colab to local machine python python

Exporting Data from google colab to local machine


Try this

from google.colab import filesfiles.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


Try this:

First you can save the file using pandas to_csv functionality later on you can download that file using google colab files functionality.

from google.colab import filesdf.to_csv('filename.csv') files.download('filename.csv')


Downloading files to your local file system

files.download will invoke a browser download of the file to your local computer.

from google.colab import fileswith open('example.txt', 'w') as f:  f.write('some content')files.download('example.txt')