I'm new in python and I use Google Colab
. I uploaded a train_data.npy
into google Colab and then I want to use it . According to this link How to import and read a shelve or Numpy file in Google Colaboratory?
when i run my code i face this error :
TypeError: 'dict_keys' object does not support indexing
Here is my code :
uploaded = files.upload()
for fn in uploaded.keys():
print('User uploaded file "{name}" with length {length} bytes'.format(
name=fn, length=len(uploaded[fn])))
with open('train_data.npy', 'w') as f:
f.write(uploaded[uploaded.keys()[0]])
Thanks