from google.colab import files uploaded = files.upload() code example
Example 1: colab mount drive
from google.colab import drive
drive.mount('/content/drive')
%cd drive/My Drive/DIRECTORY_IN_YOUR_DRIVE
Example 2: how to upload a file in colab
from google.colab import files
uploaded = files.upload()
import io
df2 = pd.read_csv(io.BytesIO(uploaded['Filename.csv']))
Example 3: upload file in colab
from google.colab import files
files.upload()
Example 4: colab read file
from google.colab import files
import io
uploaded = files.upload()
df2 = pd.read_csv('Filename.csv')