执行以下代码:
from nsepy import get_history
from datetime import date
from nsetools import Nse
import xlsxwriter
stock = Nse().get_stock_codes()
workbook = xlsxwriter.Workbook("HistoricalData.xlsx")
for i in stock.keys():
data = get_history(symbol=i,start=date(2018,1,1),end=date(2018,1,31))
worksheet = workbook.add_worksheet(i)
worksheet.write("A1",data)
if(i=="63MOONS"):
break
workbook.close()
导致以下错误:
TypeError: Unsupported type <class 'pandas.core.frame.DataFrame'> in write()
如何解决这个问题?