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

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

Moved orange to Orange (part 2)

Line 
1# xtest: RANDOM
2
3import orange
4
5data1 = orange.ExampleTable("merge1")
6data2 = orange.ExampleTable("merge2", use = data1.domain)
7
8a1, a2 = data1.domain.attributes
9
10metas = data1.domain.getmetas()
11m1, m2 = data1.domain["m1"], data1.domain["m2"]
12m1i, m2i = data1.domain.metaid(m1), data1.domain.metaid(m2)
13
14a1, a3 = data2.domain.attributes
15n1 = orange.FloatVariable("n1")
16n2 = orange.FloatVariable("n2")
17
18newdomain = orange.Domain([a1, a3, m1, n1])
19newdomain.addmeta(m2i, m2)
20newdomain.addmeta(orange.newmetaid(), a2)
21newdomain.addmeta(orange.newmetaid(), n2)
22
23merge = orange.Example(newdomain, [data1[0], data2[0]])
24print "First example: ", data1[0]
25print "Second example: ", data2[0]
26print "Merge: ", merge
Note: See TracBrowser for help on using the repository browser.