source: orange/Orange/testing/regression/tests_20/reference_tab-basket.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 654 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

Line 
1# Description: Shows how to add basket attribute to a tab-delimited file
2# Category:    data input
3# Classes:     ExampleTable
4# Uses:        tab-basket
5# Referenced:  tabdelimited.htm
6
7import orange
8d = orange.ExampleTable("tab-basket")
9for i in d[:5]:
10    print i
11print
12
13d.save("del.tab")
14
15d2 = orange.ExampleTable("del.tab")
16for i in d[:5]:
17    print i
18
19import os
20os.remove("del.tab")
21
22def sorted(metas):
23    l = metas.values()
24    l.sort(lambda x,y:cmp(x.name, y.name))
25    return l
26
27print "All metas: ", sorted(d.domain.getmetas())
28print "Required metas: ", sorted(d.domain.getmetas(False))
29print "Optional metas: ", sorted(d.domain.getmetas(True))
Note: See TracBrowser for help on using the repository browser.