Complete beginner here.
I'm trying to write a program in Python which takes a user input and plugs it into a Panda block of code to produce a table of stock prices in a date range.
So far, my input block looks like this:
StockCount = input ('Input the number of stocks in the portfolio: ')
StockTickerArray = list()
for i in range(1,StockCount+1):
StockTicker = raw_input ('Enter Stock Ticker '+str(i)+': ')
StockTickerArray.append(str(StockTicker))
"""
print "you entered", StockTicker
"""
print 'ARRAY: ', StockTickerArray
So, let's say you enter just 1 stock: AAPL. That's the input. I want to be able to take AAPL and plug it in DataReader where it says "Stock Goes Here". Is that possible?
from pandas.io.data import DataReader
from datetime import datetime
stock = DataReader("STOCK GOES HERE", "yahoo", datetime(2009,1,1))
print stock ["Adj Close"]
Thanks