Google colaboratory 在google colab research中从多个工作表中提取数据
我可以使用Google colaboratory 在google colab research中从多个工作表中提取数据,google-colaboratory,gspread,Google Colaboratory,Gspread,我可以使用 from google.colab import auth auth.authenticate_user() import gspread from oauth2client.client import GoogleCredentials gc = gspread.authorize(GoogleCredentials.get_application_default()) worksheet = gc.open('RoutePlannerCumOptimizerInput
from google.colab import auth
auth.authenticate_user()
import gspread
from oauth2client.client import GoogleCredentials
gc = gspread.authorize(GoogleCredentials.get_application_default())
worksheet = gc.open('RoutePlannerCumOptimizerInputSheet').sheet1
它不以工作表名称为参数,我的电子表格有三张工作表,我只能访问一张工作表。如何访问其他工作表并在同一谷歌电子表格中提取数据。非常感谢您的帮助 尝试使用
获取工作表
功能。这是一个:
按索引选择工作表。工作表索引从零开始:
worksheet = sh.get_worksheet(0)
或按标题:
worksheet = sh.worksheet("January")
或最常见的情况:表1:
worksheet = sh.sheet1
要获取所有工作表的列表,请执行以下操作:
worksheet_list = sh.worksheets()