![](/img/trans.png)
[英]How can get ' USDJPY'(currency rates) with pandas and yahoo finance?
[英]Get the currency unit of a symbol Yahoo Finance
要從 Yahoo Finance 檢索黃金價格,我只需要執行以下操作:
web.get_data_yahoo("GC=F")
如何獲得貨幣單位? 在這種情況下,我想要“USD”; 甚至更好的“美元/盎司”。 對於原油,它將是“美元”; 甚至更好的“美元/桶”。
謝謝
# pip install yfinance
import yfinance as yf
gold = yf.Ticker("GC=F")
print(gold.info['currency'])
結果:
USD
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.