1

I use following codes to save some data frame data, in Google Colab. But it is saved in the "local file system", not in my computer nor Google Drive. How can I get the Excel file from there? Thanks!

writer = pd.ExcelWriter('hey.xlsx')
df.to_excel(writer)
writer.save()
richard_lzy
  • 31
  • 1
  • 1
  • 5

2 Answers2

3
from google.colab import files
files.download('result.csv')

Use Google Chrome. Firefox shows Network Error.

shawon
  • 984
  • 7
  • 15
0

You'll want to upload the file using something like:

from google.colab import files
uploaded = files.upload()

Then, you can pick out the file data using something like uploaded['your_file_here.xls'].

There's a distinct question that includes recipes for working with Excel files in Drive that might be useful: https://stackoverflow.com/a/47440841/8841057

Bob Smith
  • 36,107
  • 11
  • 98
  • 91