Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
To get fundamentals for top most liquid universe

I am trying to write down a code that can get me the fundamentals for top most liquid universe. I am taking intersection of securities returned by set_universe and securities returned by get_fundamentals query . But the resulting set doesn't not contain fundamental data.How do I go about it ?

The resulting set by both of the following codes doesn't have fundamentals (pandas dataframe that i require)

def initialize(context):  
    set_universe(universe.DollarVolumeUniverse(floor_percentile=93.8, ceiling_percentile=100.0))  
    context.secs = []  
def before_trading_start(context):  
    fundamentals_df = get_fundamentals(  
        query( fundamentals.valuation.shares_outstanding,  
               fundamentals.valuation.market_cap,  
        )  
        .filter( fundamentals.valuation.shares_outstanding != None  
             )  
        .order_by( fundamentals.valuation.market_cap  
        )  
        .limit(5000)  
    )  
    context.stocks = fundamentals_df  
def handle_data(context,data):  
    bt_secs = context.stocks  
    #context.secs = set(bt_secs)  & set(data.keys())  
    for stock in data:  
        for sec in bt_secs:  
            if stock.symbol == sec.symbol:  
                context.secs.append(sec)  
    x = len(context.secs)  
def initialize(context):  
    set_universe(universe.DollarVolumeUniverse(floor_percentile=93.8, ceiling_percentile=100.0))  
    context.secs = []  
def before_trading_start(context):  
    fundamentals_df = get_fundamentals(  
        query( fundamentals.valuation.shares_outstanding,  
               fundamentals.valuation.market_cap,  
        )  
        .filter( fundamentals.valuation.shares_outstanding != None  
             )  
        .order_by( fundamentals.valuation.market_cap  
        )  
        .limit(5000)  
    )  
    context.stocks = fundamentals_df  
def handle_data(context,data):  
    bt_secs = context.stocks  
    context.secs = set(bt_secs)  & set(data.keys())  
    x = len(context.secs)