efinance
efinance copied to clipboard
get_quote_history获取道琼斯工业指数、纳斯达克指数历史数据不正确
code=['DJIA','SPX','IXIC'] df=ef.stock.get_quote_history(code,beg='20100101',end='20220722') 获取的道琼斯工业指数、纳斯达克指数历史数据不正确
code=['DJIA','SPX','IXIC']
df=ef.stock.get_quote_history(code,beg='20100101',end='20220722')
获取的道琼斯工业指数、纳斯达克指数历史数据不正确
这是因为提供的代码有多个对应的搜索结果,为了确保结果是你想要的,可以加个前缀,详情参考下面的链接:https://github.com/Micro-sheep/efinance/issues/74
![截屏2022-07-25 23 53 02](https://user-images.githubusercontent.com/19809895/180821776-4cc8fc64-8117-4094-bd61-69f8d37302a7.png)
![]()
没明白,还请大佬指点
前缀不是随便加的,你参考一下这里,调用关键词搜索确定前缀:https://github.com/Micro-sheep/efinance/issues/30#issuecomment-1164360290
感谢大佬,明白了