Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pipeline, morningstar asset_classification

I want to add column with the group code of each company. Here's what I've tried:

from quantopian.pipeline.data.morningstar import valuation_ratios, asset_classification  
from quantopian.pipeline.factors import Latest

group_code = Latest(inputs=[asset_classification.morningstar_industry_group_code])  

Then I get this error:
TypeError: Latest expected an input of dtype float64, but got int64 instead.

After that, I just tried:

pipe.add(asset_classification.morningstar_industry_group_code, 'group_code')  
run_pipeline(pipe, start_date='2016-06-27', end_date='2016-06-28')  

And got:
TypeError: 'AdjustedArray' object has no attribute '__getitem__'

How should this be done? Do I need a CustomFactor?

2 responses

Hello,

Is this what you are looking for?

from quantopian.pipeline.data.morningstar import valuation_ratios, asset_classification

group_code = asset_classification.morningstar_industry_group_code.latest  

-Arthur

Yes, I eventually found this but forgot to update this post.

Thank you, anyway.