Hi,
I am trying to build custom filter with morningstar.asset_classification.financial_health_grade but I keep getting the following error ValueError: setting an array element with a sequence. It seems like error happened somewhere at out[:]. Can someone help me figure out what I am doing wrong ?
Thank you
from quantopian.pipeline import Pipeline, CustomFactor
from quantopian.research import run_pipeline
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.data import morningstar
import pandas as pd
import numpy as np
class test_class(CustomFactor):
inputs = [morningstar.asset_classification.financial_health_grade]
window_length = 1
def compute(self, today, assets, out, test):
out[:]=test
def make_pipeline():
price= USEquityPricing.close.latest
class_test = test_class()
morning_test =morningstar.asset_classification.financial_health_grade.latest
return Pipeline(columns={'moring test': morning_test,
'close_price':price,
'class test': class_test})
my_pipe=make_pipeline()
results=run_pipeline(my_pipe, '2015-01-01', '2015-01-01')
results.head ()