source: orange/Orange/doc/reference/exampletable3.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 687 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Description: Shows how to filter examples in ExampleTable using method 'filter'
2# Category:    basic classes, preprocessing, filtering
3# Classes:     ExampleTable
4# Uses:        lenses
5# Referenced:  ExampleTable.htm
6
7import orange
8
9data = orange.ExampleTable("lenses")
10
11young = data.filter(age="young")
12print "Selection: age=young"
13for ex in young:
14    print ex
15print
16
17
18young = data.filter(age=["young", "presbyopic"], astigmatic="yes")
19print "Selection: age=young or presbyopic, astigmatic=yes"
20for ex in young:
21    print ex
22print
23   
24print "Selection: NOT age=young, astigmatic=yes"
25young = data.filter({"age": "young", "astigmatic": "yes"}, negate=1)
26for ex in young:
27    print ex
Note: See TracBrowser for help on using the repository browser.