Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@ashwin19091990 ashwin19091990 commented Jun 10, 2018

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