Open e1-git opened 3 months ago
works for me, need more info on the settings and environments to locate and reproduce the error
os: Ubuntu 22.04 LTS python version: 3.10.9 (main, Mar 1 2023, 18:23:06) [GCC 11.2.0] xalpha version: 0.11.11
os: macos Ventura 13.0.1 python version: 3.10.13 (main, Sep 11 2023, 08:16:02) [Clang 14.0.6 ] xalpha version: 0.12.0
KeyError Traceback (most recent call last)
File ~/anaconda3/lib/python3.10/site-packages/xalpha/universal.py:1993, in cachedio.
KeyError: 'SH600036'
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last) Cell In[5], line 6 ----> 6 xa.get_daily("SH600036", prev=15)
File ~/anaconda3/lib/python3.10/site-packages/xalpha/universal.py:2051, in cachedio.
File ~/anaconda3/lib/python3.10/site-packages/xalpha/universal.py:1128, in _get_daily(code, start, end, prev, _from, wrapper, handler, **kws) 1125 elif from in ["xueqiu", "xq", "snowball", "XQ"]: 1126 code, type = decouple_code(code) -> 1128 df = get_historicalfromxq(code, count, type=type_) 1129 df = prettify(df) 1130 elif _from in ["zhongjianjia", "zjj", "chinamoney", "ZJJ"]:
File ~/anaconda3/lib/python3.10/site-packages/xalpha/universal.py:168, in get_historicalfromxq(code, count, type, full) 160 # pe 是 TTM 数据 161 r = rget_json( 162 url.format( 163 code=code, tomorrow=int(tomorrowts() * 1000), count=count, type=type_ (...) 166 headers={"user-agent": "Mozilla/5.0"}, 167 ) --> 168 df = pd.DataFrame(data=r["data"]["item"], columns=r["data"]["column"]) 169 df["date"] = (df["timestamp"]).apply(ts2pdts) # reset hours to zero 170 return df
KeyError: 'item'
I use xalpha 0.12.0, also the get_daily does not work
邮件已收到~~我会查看之后回复您
{'data': {'items': [], 'items_size': 0}, 'error_code': 0, 'error_description': ''}
File ~/opt/anaconda3/lib/python3.10/site-packages/xalpha/universal.py:171, in get_historicalfromxq(code, count, type, full) --> 171 df = pd.DataFrame(data=r["data"]["item"], columns=r["data"]["column"]) 172 df["date"] = (df["timestamp"]).apply(ts2pdts) # reset hours to zero 173 return df
KeyError: 'item'