from WindPy import w
import pandas as pd
w.start()
wdata = w.wset("sectorconstituent","date=2017-05-08;sectorid=a001010100000000")
df = pd.DataFrame()
df['code'] = wdata.Data[1]
df['sec_name'] = wdata.Data[2]
df.to_csv('allstocks.csv',index=False)
万得数据写入Excel
最新推荐文章于 2024-09-10 14:09:51 发布