G'day我只是想知道如何通过python使用yfinance模块分离股票价格,然后将该价格存储为变量,任何帮助都将不胜感激
import yfinance as yf
ticker = 'MSFT'
tickerData = yf.Ticker(ticker)
#get the historical prices for this ticker
tickerDf = tickerData.history(period='1d')
#see your data
tickerDf
这是可行的,但我最终得到的结果是,我试图隔离和存储价格的各种尝试(最后)都失败了。 output
非常感谢您的帮助
如果要在单独的数据框“close_df”中隔离
Date
和Close
列,可以使用:并且,如果您希望在“closed_values_list”列表中使用
Close
值,请使用相关问题 更多 >
编程相关推荐