import data from drive to colab code example

Example 1: connect google drive to colab

from google.colab import drive
drive.mount("/content/gdrive")

Example 2: colab mount drive

from google.colab import drive
drive.mount('/content/drive')

#Optional: move to the desired location:
%cd drive/My Drive/DIRECTORY_IN_YOUR_DRIVE

Example 3: upload file in colab

from google.colab import files
files.upload()

Example 4: how to import dataset from drive to colab

json_import = drive.CreateFile({'id':'29PGh8XCts3mlMP6zRphvnIcbv27boawn'})

json_import.GetContentFile('sample.json') - 'sample.json' is the file name that will be accessible in the notebook.