There is a bug in the implementation (thanks Zhongyuan Zhou). In the download_data function there is no need to set the data.columns to be the stocks.
def download_data(stocks): data = web.DataReader(stocks,data_source='yahoo',start=start_date,end=end_date)['Adj Close'] return data
So this is the good code snippet above! Sorry for the inconvenience!