Skip to main content

Appendix A — The yfinance Package

Fetching data from Yahoo Finance:

import yfinance as yf

symbol = "NVDA"
df = yf.download(symbol, start="2014-01-01", end="2024-01-31")
df.head()

[*********************100%***********************]  1 of 1 completed
Price Close High Low Open Volume
Ticker NVDA NVDA NVDA NVDA NVDA
Date
2014-01-02 0.372991 0.375813 0.369699 0.374402 260092000
2014-01-03 0.368523 0.374402 0.367347 0.373697 259332000
2014-01-06 0.373462 0.376284 0.368758 0.372286 409492000
2014-01-07 0.379576 0.380987 0.374637 0.377224 333288000
2014-01-08 0.384750 0.386631 0.379576 0.380987 308192000