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?