# source:orange/docs/tutorial/rst/code/domain3.py@9374:59bac7ddd8a2

Revision 9374:59bac7ddd8a2, 1.3 KB checked in by mitar, 2 years ago (diff)

Tutorial documentation structure.

Line
1# Description: Shows different uses of orange.Domain
2# Category:    preprocessing
3# Uses:        glass
4# Classes:     Domain
5# Referenced:  domain.htm
6
7import orange
8
9domain = orange.ExampleTable("glass").domain
10
11tests = ( '(["Na", "Mg"], domain)',
12          '(["Na", "Mg"], 1, domain)',
13          '(["Na", "Mg"], 0, domain)',
14          '(["Na", "Mg"], domain.variables)',
15          '(["Na", "Mg"], 1, domain.variables)',
16          '(["Na", "Mg"], 0, domain.variables)',
17          '([domain["Na"], "Mg"], 0, domain.variables)',
18          '([domain["Na"], "Mg"], 0, domain)',
19          '([domain["Na"], "Mg"], 0, domain.variables)',
20          '([domain["Na"], domain["Mg"]], 0)',
21          '([domain["Na"], domain["Mg"]], 1)',
22          '([domain["Na"], domain["Mg"]], None)',
23          '([domain["Na"], domain["Mg"]], orange.EnumVariable("something completely different"))',
24          '(domain)',
25          '(domain, 0)',
26          '(domain, 1)',
27          '(domain, "Mg")',
28          '(domain, domain[0])',
29          '(domain, None)',
30          '(domain, orange.FloatVariable("nothing completely different"))')
31
32for args in tests:
33  line = "orange.Domain%s" % args
34  d = eval(line)
35  print line
36  print "  classVar: %s" % d.classVar
37  print "  attributes: %s" % d.attributes
38  print
Note: See TracBrowser for help on using the repository browser.