Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Custom Factor with boolean values?

I created a custom factor that returns boolean values but they are displayed as 0.0 and 1.0 in the research notebook.
Why? How can I get booleans?

Thanks

4 responses

Did you try result.astype('bool')?

I just tried it and the values are still not considered booleans in the display.

Define it as a CustomFilter and not a CustomFactor. Filters return boolean values. Factors return real values.

See attached.

Ha thanks, that worked.
I did not realize that booleans values would be changed to numerical values because it's a Factor.
Making it a Filter works and I don't see any drawback.