waditu / tushare

TuShare is a utility for crawling historical data of China stocks
BSD 3-Clause "New" or "Revised" License
12.79k stars 4.28k forks source link

Exception: fields 列表类型 #1213

Open imfoli opened 4 years ago

imfoli commented 4 years ago

File "D:\devenv\python\Anaconda3\lib\site-packages\tushare\pro\client.py", line 43, in query raise Exception(result['msg']) Exception: fields 列表类型

这是啥问题????

tushare昵称:leochan007

imfoli commented 4 years ago

服务器是正好升级了吗?

df = pro.opt_basic(exchange='DCE', fields='ts_code,name,exercise_type,list_date,delist_date')

把注释代码改写成如下就可以了??

df = pro.opt_basic(exchange='DCE', fields=['ts_code','name','exercise_type','list_date','delist_date'])

imfoli commented 4 years ago

JSONDecodeError Traceback (most recent call last)

in 6 token = f.read() 7 pro = ts.pro_api(token) ----> 8 df = pro.opt_basic(exchange='DCE', fields='ts_code,name,exercise_type,list_date,delist_date') 9 #df = pro.opt_basic(exchange='DCE', fields=['ts_code','name','exercise_type','list_date','delist_date']) 10 print(df.head()) 返回值时刻在变??