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方法将字节输入,所以我不明白?