The following code fails to work in research platform. Please advise.
import numpy as np
fundamentals = init_fundamentals()
S = 200
fundamental_df = get_fundamentals(query(fundamentals.company_reference.sid)
.filter(fundamentals.valuation.market_cap != None)
.filter(fundamentals.company_reference.primary_exchange_id != "OTCPK") # no pink sheets
.filter(fundamentals.share_class_reference.security_type == 'ST00000001') # common stock only
.filter(~fundamentals.share_class_reference.symbol.contains('_WI')) # drop when-issued
.filter(fundamentals.share_class_reference.is_primary_share == True) # remove ancillary classes
.filter(fundamentals.share_class_reference.is_depositary_receipt == False) # !ADR/GDR
.filter(fundamentals.valuation.market_cap > 1e+9)
.order_by(fundamentals.valuation.market_cap.desc())
.limit(20), '2013-01-01')
stocks = fundamental_df.loc['sid']
prices = get_pricing(stocks,start_date='2011-06-01',end_date = '2011-08-01',fields='price',frequency='daily')
data = prices.dropna(axis=1).values
print np.shape(data)