How to import and read a shelve or Numpy file in Google Colaboratory?
问题 I have file.npy and I want to load it in Google Colaboratory Notebook. I already know that I must load the file from Google Drive, however I have no idea how to do so. Any help is welcome 回答1: Upload your file into Colaboratory Notebook with the following: from google.colab import files uploaded = files.upload() Then you can reach the contents of your file from uploaded object and then write it into a file: with open("my_data.h5", 'w') as f: f.write(uploaded[uploaded.keys()[0]]) If you run: