How do you filter by stocks with no dividend using the pipeline?
class DividendYield(CustomFactor):
"""
Computes the difference between the highest high and the lowest
low of each over an arbitrary input range.
"""
inputs = [valuation_ratios.dividend_yield]
def compute(self, today, assets, out, dividend_yield):
out[:] = dividend_yield
This gives me 3 stocks:
dyield = DividendYield(window_length=1)
no_dividend = (dyield <= 0.001)
This gives me 0:
dyield = DividendYield(window_length=1)
no_dividend = (dyield == None)
It looks like when you attempt to do equality it doesn't overload __eq__ so it just does a straight comparison, which is always False.