

def Stock_Prices():
    df = pd.DataFrame()
    statspath = (path + '/_KeyStats')
    stock_list = [x[0] for x in os.walk(statspath)]
    for each_dir in stock_list[1:]:
        try:
            ticker = os.path.basename(os.path.normpath(each_dir))
            name = ('WIKI/' + ticker.upper())
            print(name)
            data = Quandl.get(name, trim_start='2000-12-12', trim_end='2014-12-30', authtoken=auth_tok)
            data[ticker.upper()] = data['Adj. Close']
            df = pd.concat([df, data[ticker.upper()]], axis=1)
        except Exception as e:
            print(str(e))
            time.sleep(10)
            try:
                ticker = os.path.basename(os.path.normpath(each_dir))
                name = ('WIKI/' + ticker.upper())
                data = Quandl.get(name, trim_start='2000-12-12', trim_end='2014-12-30', authtoken=auth_tok)
                data[ticker.upper()] = data['Adj. Close']
                df = pd.concat([df, data[ticker.upper()]], axis=1)
            except Exception as e:
                print(str(df))
    df.to_csv('stock_prices.csv')

dataset/ETHPy150Open cleesmith/sentdex_scikit_machine_learning_tutorial_for_investing/p17.py Stock_Prices/VarMisuse@280/358 `e`->`df`