问题
I wrote
from pandas_datareader import data as pdr
import yfinance as yf
data = pdr.get_data_yahoo("AAPL", start='2020-04-12', end='2020-04-13', interval="m")
And I got a error
KeyError 'Date'
I heard people saying Yahoo finance API is down but I still can get the following code working correctly
data = pdr.get_data_yahoo("AAPL", start='2020-04-12', end='2020-04-13')
回答1:
pandas_datareader interval="m"
means 1 month you need yfinance.
pip download yfinance
import yfinance
a = yfinance.download(ticker="your symbol",period="5d",interval="1m")
来源:https://stackoverflow.com/questions/61810596/problem-with-1m-interval-in-get-data-yahoopandas-datareader