I have a csv file with 1500 stocks with model ranks. I am trying to add a column to this dataframe that is the stock price for the symbol in the first column..
import pandas as pd
import numpy as np
df = pd.read_csv('SmallScreen.csv')
df = df.drop(df.index[:16])
df = df[[0, 1, 3, 4, 5, 6, 7]]
df.dropna(how='all')
df.columns = ['symbol', 'company', 'valuation', 'cap dep', 'earnings','market','core']
df = df.set_index('symbol')
Here is where I am stuck...
df['Price'] = web.DataReader(df['symbol'], 'yahoo', '2015-11-17", '2015-11-17")['Adj Close']
df = df.sort(['core'], ascending=[True])
df.to_csv('RankSmall_1.csv')