Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 如何动态设置";“范围”;从panda添加数据时的google工作表_Python 3.x_Pandas_Google Sheets_Google Sheets Api - Fatal编程技术网

Python 3.x 如何动态设置";“范围”;从panda添加数据时的google工作表

Python 3.x 如何动态设置";“范围”;从panda添加数据时的google工作表,python-3.x,pandas,google-sheets,google-sheets-api,Python 3.x,Pandas,Google Sheets,Google Sheets Api,我想使用GoogleSheetsAPI将熊猫的数据附加到GoogleSheets。检查文档时,需要参数范围。到目前为止,我在谷歌表单中设置了最大可能值,见类似帖子。但这并不能解决我的问题。所以我可以动态地使用 batch_update_spreadsheet_request_body = { 'majorDimension': 'ROWS', 'values': df.values.tolist(), } response = se

我想使用GoogleSheetsAPI将熊猫的数据附加到GoogleSheets。检查文档时,需要参数范围。到目前为止,我在谷歌表单中设置了最大可能值,见类似帖子。但这并不能解决我的问题。所以我可以动态地使用

batch_update_spreadsheet_request_body = {
            'majorDimension': 'ROWS',
            'values': df.values.tolist(),
        }
response = service.spreadsheets().values().append(spreadsheetId=google_sheets_id, valueInputOption='RAW', body=batch_update_spreadsheet_request_body, range='A1:AA1000').execute()

正如在报告中所写

追加值时,此字段表示要搜索表的范围,之后将追加值


因此,您只需添加要附加到的表的左侧顶部单元格区域。

只需
A1
就可以了。很好,可以了。