python - Pandas ExcelWriter 断开了来自 web 的 excel 外部连接
问题描述
我的意图是将数据框附加到现有的 excel 文件中。这个 excel 文件有一个名为“价格”的工作表,这个工作表有一个来自 Web 的外部连接。
当我运行代码(如下)并附加数据框时,连接消失了。
有什么推荐吗?
#Export to excel
options = {}
options['strings_to_formulas'] = False
options['strings_to_urls'] = False
path = 'Produtos.xlsx'
book = load_workbook(path)
writer = pd.ExcelWriter('Produtos.xlsx', engine='openpyxl',options=options)
writer.book = book
writer.sheets = {ws.title: ws for ws in book.worksheets}
BDR_df.to_excel(writer, sheet_name='BDR', index = False)
writer.close()
writer.handles = None
解决方案
推荐阅读
- javascript - 将字符串转换为对象键超过 2depths
- webpack - Webpack dll 参考插件给出运行时错误
- javascript - 选择文本时显示工具提示
- python - 更改按钮文本 MessageBox
- text-mining - 如何解决情感分析中的歧义?
- reactjs - React 上下文更新不会导致组件重新渲染
- google-data-studio - 在 Google 数据洞察中根据单独的年、月和日创建复合日期
- python - 在Python的openpyxl中用颜色填充行Excel
- java - spring-kafka 以非常长的任务多次处理相同的消息。
- caffe - 包含自定义层的 Core ML 模型很慢