python提取wind数据_用Python从wind获取数据,转换成dataframe格式,并保存为Excel文件,excel...
import openpyxlfrom openpyxl.workbook import Workbookfrom WindPy import *from pandas import *import numpy as npimport pandas as pdw.start();data=w.wss(“031390396.IB,031490164.IB”, “sec_name,trade_code
import openpyxl
from openpyxl.workbook import Workbook
from WindPy import *
from pandas import *
import numpy as np
import pandas as pd
w.start();
data=w.wss(“031390396.IB,031490164.IB”, “sec_name,trade_code,issue_issuemethod,windl2type,issue_firstissue,ipo_cappaydate,rate_ratebond,latestissurercreditrating2,issue_amountplan,issue_issueyear,termnote,issuershortened,industry2,province,agency_leadunderwriter,agency_guarantor,latestratingofguarantor”,“tradeDate=20200305;ratingAgency=101;type=1;unit=1;industryType=1;industryStandard=1”)
data=pd.DataFrame(data.Data,index=data.Fields)
data=data.T #转置
writer = pd.ExcelWriter(‘112.xlsx’)
data.to_excel(writer, sheet_name=‘Data1’, startcol=0, index=False)
writer.save()
DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐


所有评论(0)