Skip to content

Instantly share code, notes, and snippets.

@sagarhowal
Created December 25, 2017 10:38
Show Gist options
  • Save sagarhowal/1f0cb555408d73427bcdac6febdfdbd1 to your computer and use it in GitHub Desktop.
Save sagarhowal/1f0cb555408d73427bcdac6febdfdbd1 to your computer and use it in GitHub Desktop.
Upload Dataset on Google Colaboratory.
#Uploading the Dataset
from google.colab import files
uploaded = files.upload()
#Save uploaded file on the Virtual Machine's
#Thanks to user3800642 from StackOverflow
with open("breast_cancer.csv", 'w') as f:
f.write(uploaded[uploaded.keys()[0]])
@ashwin19091990
Copy link

Hello Sagar

Try this

from google.colab import files

uploaded = files.upload()

for fn in uploaded.keys():
print('User uploaded file "{name}" with length {length} bytes'.format(
name=fn, length=len(uploaded[fn])))

from documentation as above code does not fec any bytestream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment