Orange Forum • View topic - PythonVariable for Boolean Type

PythonVariable for Boolean Type

A place to ask questions about methods in Orange and how they are used and other general support.

PythonVariable for Boolean Type

Postby Feanor76 » Wed Nov 02, 2005 23:08

Hi all,

I'm trying to figure out this rabbit hole. What I need is something that 1) is a DiscreteType and 2) will be properly evaluated by Python's builtin operator.or_ .

It seems like I should be able to do this with a PythonVariable -- the underlying data would simply be a Python boolean (True, False) and if I used it in a feature construction setting I could just apply operator.or_ to the values (or would this need to apply to the svalues .... how can we get at these?).

The attribute types in python doc talks about using a Python list as the underlying data structure for a Python and when a learner requests that attribute, the list length is returned. Unfortunately, I don't see a fleshed out example for that on that doc page.

Basically, when using a PythonVariable, how can we control the "view" that is taken of that variable?


Return to Questions & Support