xxxxxxxxxx
from google.colab import drive
drive.mount('/content/drive')
# Specify the path of the file in your Google Drive
file_path = '/content/drive/MyDrive/path/to/your/file.ext'
# Read the file using appropriate methods (e.g., pandas, numpy, etc.)
# Example for reading a CSV file using pandas:
import pandas as pd
data = pd.read_csv(file_path)
# Start using the file in your Colab notebook
# For example, print the first few rows of the data
print(data.head())
Copy this code, paste it and nver come back here.
xxxxxxxxxx
from google.colab import drive
drive.mount("/content/drive")
xxxxxxxxxx
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
xxxxxxxxxx
downloaded = drive.CreateFile({'id':"your_file_ID"}) # replace the id with id of file you want to access
downloaded.GetContentFile('your_file_name.csv') # replace the file name with your file
xxxxxxxxxx
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)