xlwings 不会从此数据帧复制超过 8 行的任何原因?

Any reason why xlwings will not copy more than 8 lines from this dataframe?

我刚刚开始学习 xlwings 并将信息从 python 复制到 excel。但是,这不会复制所有信息。 xlwings 的任何专家都知道为什么并且可以解决这个问题?公司信息中有 154 行,但只有 8 行被复制到 excel,然后停止。当 运行 在 jupyter 或 IDEL 或 VS 中时,信息可见但不会复制到 excel。历史价格数据 (sheet2) 工作得很好。谢谢

import time
import pandas as pd
import numpy as np
import xlwings as xw
import yfinance as yf

stock = yf.Ticker("JPM")

wb  = xw.Book() 

info = stock.info.items()
info = pd.DataFrame(info, columns = ['keys', 'values'])
sheet1 = wb.sheets.add('Co. Info')
sheet1.range('A1').value = info

hist = pd.DataFrame(stock.history(period="max"))
sheet2 = wb.sheets.add('Px Hist')
sheet2.range('A1').value = hist

在 jupyter 或 IDLE 中 运行 时,sheet1 或“Co. Info”中字典“info”的输出如下所示:

dict_items([('zip', '95014'), ('sector', 'Technology'),....... 
 ('preMarketPrice', 175.84), ('logo_url', 'https://logo.clearbit.com/apple.com')])

仔细查看 pandas 数据框的第 8 行 info。列 values8 的单元格包含一个空列表 []。似乎 xlwings 无法处理将具有 pandas 数据框的空列表的单元格复制到 excel sheet。我会说这是一个错误。 如果在将 info 复制到 excel sheet 之前删除空列表,它工作正常:

import time
import pandas as pd
import numpy as np
import xlwings as xw
import yfinance as yf

stock = yf.Ticker("JPM")

wb  = xw.Book()

info = stock.info.items()
info = pd.DataFrame(info, columns = ['keys', 'values'])
info.drop(8, axis=0, inplace=True) # Remove row 8.
sheet1 = wb.sheets.add('Co. Info')
sheet1.range('A1').value = info

hist = pd.DataFrame(stock.history(period="max"))
sheet2 = wb.sheets.add('Px Hist')
sheet2.range('A1').value = hist