Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pulling and Using Data from Morningstar

Hey guy's I'm trying to pull the p/e ratio from morningstar. my code looks like this:

from quantopian.pipeline.data.builtin import USEquityPricing  
from quantopian.pipeline.data import morningstar

def create():  

    earnings=morningstar.valuation_ratios.pe_ratio  
    ratiotest=earnings<20  
    return Pipeline(  
        columns={'earnings':earnings}, screen=ratiotest)

result=run_pipeline(create(),'2015-05-05','2015-05-05')  
print result.head(50)  
x=float(len(result))  
print x  

Why wouldn't this work and can you give me an example of code that would accomplish what I'm trying to do?

Thanks!