1

It is so easy to read xlsx or csv data into a Colab script from a Google drive (even a shared drive), but it seems inordinately difficult to read in data from a gsheet file.

Is there a simple way to read in data from a Google Sheet. I just need to read in the data, I don't need to manipulate the original file.

I know about the gspread library but it is a pain to use and overkill. I just want to mount the drive and read in the data:

from google.colab import drive
drive.mount('/content/drive')
df = pd.read_gsheet('sample_file.gsheet', sheet_name='Sheet1')

I know this doesn't work (especially with pandas) but it feels like it should be that easy. These are two Google-made products, how are they this incompatable?

BForsyth
  • 21
  • 3
  • you could try the API, see for example this answer: https://stackoverflow.com/questions/63645457/google-sheet-to-pandas-via-shared-link-without-credentials-in-python – braulio Feb 03 '22 at 10:54

0 Answers0