1
我想上傳一個文件,我使用ExcelWriter通過熊貓創建。上傳Excel文件到Dropbox?
這是我到目前爲止有:
output = BytesIO()
writer = pd.ExcelWriter(output, engine='xlsxwriter')
df1.to_excel(writer, sheet_name='raw_data', index=False)
df_totals.to_excel(writer, sheet_name='totals', index=False)
writer.save()
output.seek(0)
dbx.files_upload(output, 'my_path/test.xlsx')
它引發錯誤:
TypeError: expected request_binary as binary type, got <class '_io.BytesIO'>
的file_upload方法將字節輸入,所以我不明白?