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
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
import file to colab
from google.colab import files
files.upload()
# run the above code and click on the enabled "Choose Files" button
import pandas as pd
df = pd.read_csv('your uploades file name.csv') # df is a changable variable
df.head() # shows first 5 rows
upload file in colab
from google.colab import files
files.upload()
colab import python file
# In case anyone else is interested to know how to import files/packages
# from gdrive inside a google colab. The following procedure worked for
# me:
# 1) Mount your google drive in google colab:
from google.colab import drive
drive.mount('/content/gdrive/')
# 2) Append the directory to your python path using sys:
import sys
sys.path.append('/content/gdrive/mypythondirectory')
# Now you should be able to import stuff from that directory!
colab read file
from google.colab import files
import io
uploaded = files.upload()
df2 = pd.read_csv('Filename.csv')# Dataset is now stored in a Pandas Dataframe
google colab upload a file
from google.colab import files
files.upload()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us