source: orange/orange/doc/reference/tab-basket.py @ 6538:a5f65d7f0b2c

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

Made XPM version of the icon 32x32.

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.