waditu / tushare

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

获取指数数据报错 #863

Closed KilimanjaroFreeman closed 5 years ago

KilimanjaroFreeman commented 5 years ago

import tushare as ts import matplotlib.pyplot as plt pro = ts.pro_api()

df = pro.index_daily(ts_code='399300.SZ')

df = pro.indexdaily(ts?date='201801010', end_date='20181010')

报错

Exception Traceback (most recent call last)

in () 3 pro = ts.pro_api() 4 ----> 5 df = pro.index_daily(ts_code='399300.SZ') 6 # df = pro.index_daily(ts_?date='201801010', end_date='20181010') 7 df C:\Users\Freeman\AppData\Roaming\Python\Python27\site-packages\tushare\pro\client.pyc in query(self, api_name, fields, **kwargs) 41 result = json.loads(res.text) 42 if result['code'] != 0: ---> 43 raise Exception(result['msg']) 44 data = result['data'] 45 columns = data['fields'] : (, UnicodeEncodeError('ascii', u'\u62b1\u6b49\uff0c\u60a8\u6ca1\u6709\u6743\u9650\u8bbf\u95ee\u8be5\u63a5\u53e3\uff0c\u6743\u9650\u7684\u5177\u4f53\u8be6\u60c5\u8bbf\u95ee\uff1ahttps://tushare.pro/document/1?doc_id=108\u3002', 0, 24, 'ordinal not in range(128)'))
jimmysoa commented 5 years ago

由于访问量最近过大,稍微做了点积分调整,目前是200积分,具体请参考: https://tushare.pro/document/1?doc_id=108