stocks = ['AAPL', 'GS']
data = None
for stock_name in stocks:
    stock_data = data.DataReader(stock_name, 'yahoo', '2004-01-01')
del stock_data['Close']
stock_data.rename(columns={'Adj Close': 'Close'}, inplace=True)
stock_data.columns = pd.MultiIndex.from_product([[stock_name], stock_data.
    columns])
if data is None:
    data = stock_data
else:
    data = pd.concat([data, stock_data], axis=1)
How to append to multilevel pandas dataframe using iteration?