2
案例: 我的腳本返回一個數據框,需要將其作爲新的數據行添加到現有的Google電子表格中。截至目前,我將數據框附加爲多個單一行通過gspread。將pandas數據框附加到Google電子表格中
我的代碼:
import gspread
import pandas as pd
DF=pd.DataFrame()
#After some processing a non-empty data frame has been created.
Output_conn = gc.open("SheetName").worksheet("xyz")
# Here 'SheetName' is google spreadsheet and 'xyz' is sheet in the workbook
for i,row in DF.iterrows():
Output_conn.append_row(Row)
是否有辦法追加整個數據幀而不是多個單行?