将文件从本地驱动器保存到colab.research.google.com

时间:2018-03-10 14:05:35

标签: python

我正在使用此代码将文件上传到代码实验室。

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])))

但我需要将其保存到特定目录中,以便稍后使用sklearn.datasets.load_files加载它们。

train_data = load_files(train_dir,encoding='utf-8', decode_error='ignore', random_state=2018)
test_data = load_files(test_dir,encoding='utf-8', decode_error='ignore', random_state=2018) 

感谢您提前帮助我

0 个答案:

没有答案