mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-11-30 02:48:57 +08:00
update get_index_code_name_list
This commit is contained in:
parent
6d1c176257
commit
d1a76e877f
@ -130,12 +130,12 @@ def get_index_code_name_list() -> list:
|
||||
|
||||
:return: [{'market_code': 'SHxxx'}, ...]
|
||||
"""
|
||||
if hasattr(ak, 'stock_zh_index_spot_sina'):
|
||||
if hasattr(ak, 'stock_zh_index_spot_em'):
|
||||
df = ak.stock_zh_index_spot_em()
|
||||
elif hasattr(ak, 'stock_zh_index_spot_sina'):
|
||||
df = ak.stock_zh_index_spot_sina()
|
||||
elif hasattr(ak, 'stock_zh_index_daily_tx'):
|
||||
df = ak.stock_zh_index_daily_tx()
|
||||
elif hasattr(ak, 'stock_zh_index_spot_em'):
|
||||
df = ak.stock_zh_index_spot_em()
|
||||
else:
|
||||
df = ak.stock_zh_index_spot()
|
||||
return [{'market_code': df.loc[i]['代码'].upper(), 'name': df.loc[i]['名称']} for i in range(len(df))]
|
||||
|
Loading…
Reference in New Issue
Block a user