I'm trying to run the code below and I'm getting a weird error that says 'cannot import name 'is_list_like''. I tried Googling for a solution, but I can't figure it out.
import numpy as np
import pandas as pd
import pandas_datareader as web
#import matplotlib.pyplot as plt
symbols = ['BIIB','CELG','GILD','AMGN','REGN','ILMN','VRTX','ALXN','MYL']
noa = len(symbols)
data = pd.DataFrame()
for sym in symbols:
data[sym] = web.DataReader(sym, data_source='yahoo',end='2015-05-01')['Adj Close']
data.columns = symbols
(data / data.ix[0] * 100).plot(figsize=(8, 5))
rets = np.log(data / data.shift(1))
rets.mean() * 252
rets.cov() * 252
weights = np.random.random(noa)
weights /= np.sum(weights)
print(weights)
Can someone here shed some light on this? Thanks.