使用我下载的雅虎财经,苹果的历史数据。我正在使用来自https://pypi.org/project/yahoofinancials/的信息
from yahoofinancials import YahooFinancials
ticker = 'AAPL'
yahoo_financials = YahooFinancials(ticker)
由此,我可以使用以下信息获取每周数据:
historical_price = yahoo_financials.get_historical_price_data('2020-01-05', '2021-01-05', 'weekly')
这很有效。但我正在努力把它打包成熊猫。很少有词典和词典列表让我感到困惑
电流输出为
AAPL
currency USD
eventsData {}
firstTradeDate {'formatted_date': '1980-12-12', 'date': 34547...
instrumentType EQUITY
prices [{'date': 1609736400, 'high': 133.610000610351...
timeZone {'gmtOffset': -18000}
我的问题是,将上述内容解包成可用数据帧的最佳方法是什么
我建议改用同样基于雅虎的
yfinance
:这将产生:
这与使用:
相关问题 更多 >
编程相关推荐