Extract Google Drive zip from Google colab notebook Extract Google Drive zip from Google colab notebook python python

Extract Google Drive zip from Google colab notebook


TO unzip a file to a directory:

!unzip path_to_file.zip -d path_to_directory


To extract Google Drive zip from a Google colab notebook:

import zipfilefrom google.colab import drivedrive.mount('/content/drive/')zip_ref = zipfile.ZipFile("/content/drive/My Drive/ML/DataSet.zip", 'r')zip_ref.extractall("/tmp")zip_ref.close()