API error encountered when trying to use matplotlib with gspread

Viewed 36

I'm trying to use matplotlib to plot graphs using data from a google sheet. I read the documentation and enabled Google Drive & Google Sheets API but I get an error:

APIError: {'code': 400, 'message': 'This operation is not supported for this document', 'status': 'FAILED_PRECONDITION'}

On a side note, I'm quite new to data analytics, so given a table with a column that has only '0' or '1', how can I split the dataframe and plot those rows of data with '0' or '1'?

import gspread
import pandas as pd
from google.colab import auth
from google.auth import default
auth.authenticate_user()
creds, _ = default()

gc = gspread.authorize(creds)
# sh = gc.open_by_url("")
sh = gc.open_by_key("")
worksheet = sh.worksheet("user06")
rows = worksheet.get_all_values()
pd.DataFrame.from_records(rows)
0 Answers
Related