I’m having all kinds of trouble using Pandas DataReader to download financial data from Yahoo! I’ve read multiple blog posts and the Github readme for yfinance, but when I run my code it returns:
Enter names separated by commas:
…instead of the expected stock_data table.
My code is very simple:
#IMPORT PACKAGES import pandas as pd import numpy as np from pandas_datareader import data as pdr import yfinance as yf yf.pdr_override() import matplotlib.pyplot as plt %matplotlib inline #LOAD ADJUSTED CLOSINGS symbols = yf.Ticker("msft appl goog") start_date = "2008-01-01" end_date = "2020-04-01" stock_data = pdr.get_data_yahoo(tickers = symbols, start = start_date, end = end_date) print(stock_data)
The following code is from a previous Jupyter Notebook project (Visualizing Tech Stocks). This code didn’t work either, it just returned the same prompt above.
#IMPORT PACKAGES import pandas as pd import numpy as np import pandas_datareader as web import matplotlib.pyplot as plt %matplotlib inline #LOAD ADJUSTED CLOSINGS symbols = ["MSFT", "AMZN", "AAPL", "GOOG", "FB"] start_date = "2019-01-01" end_date = "2019-07-01" stock_data = web.get_data_yahoo(symbols, start_date, end_date)
Can anyone point me in the right direction?