For a spreadsheet file, the basic idea is to use the gspread and pandas packages to read spreadsheets on Drive and convert them to the pandas dataframe format.
In a Colab laptop:
#install packages !pip install --upgrade -q gspread !pip install gspread-dataframe !pip install pandas
Then I know 3 ways to read Google spreadsheets.
By file name:
spreadsheet = gc.open("goal.csv")
By URL:
spreadsheet = gc.open_by_url('https://docs.google.com/spreadsheets/d/1LCCzsUTqBEq5pemRNA9EGy62aaeIgye4XxwReYg1Pe4/edit#gid=509368585')
By file / ID key:
spreadsheet = gc.open_by_key('1vpukIbGZfK1IhCLFalBI3JT3aobySanJysv0k5A4oMg')
I shared the code above on a Colab laptop: https://drive.google.com/file/d/1cvur-jpIpoEN3vAO8Fd_yVAT5Qgbr4GV/view?usp=sharing
source share