如何在 Google Colab 中读取压缩文件?

时间:2021-05-05 10:27:08

标签: python google-colaboratory

我正在将我的 Google 驱动器安装到 Google Colab 以读取压缩文件。

以下是我收到的错误!如何做到这一点?

import zipfile
from google.colab import drive
drive.mount('/content/drive')
zip_ref = zipfile.ZipFile("/content/drive/MyDrive/data_preprocessed_python.zip", 'r')
zip_ref.extractall("/tmp")
zip_ref.close()

我的路径位置 /content/drive/MyDrive/data_preprocessed_python.zip/

这是我的错误

File "<ipython-input-8-9a9dab1be34f>", line 1
    drive/MyDrive/content/drive/MyDrive/data_preprocessed_python.zip/
                                                                     ^
SyntaxError: invalid syntax

0 个答案:

没有答案