source: orange/orange/doc/reference/filters.py @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 778 bytes checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

Line 
1import orange
2
3
4############ THIS IS WHAT YOU CAN DO WITH DISCRETE ATTRIBUTES
5
6data = orange.ExampleTable("lenses")
7
8data[0][0] = "?"
9data[1][0] = "?"
10data[1][1] = "?"
11
12fspec = orange.Filter_isDefined(domain=data.domain)
13print "\nCheck all attributes"
14print [fspec(ex) for ex in data]
15
16print "\nCheck all attributes (but with 'check' given)"
17fspec.check = [1] * len(data.domain)
18print [fspec(ex) for ex in data]
19
20print "\nIgnore the first attribute"
21fspec.check[0] = 0
22print [fspec(ex) for ex in data]
23
24print "\nIgnore the first attribute, check the second (and ignore the rest, list is too short)"
25fspec.check = [0, 1]
26data[0][3] = "?"
27print [fspec(ex) for ex in data]
28
29print "\nAdd the 'age' to the list of the checked"
30fspec.check["age"] = 1
31print [fspec(ex) for ex in data]
Note: See TracBrowser for help on using the repository browser.