source: orange/Orange/doc/ofb/domain1.py @ 9671:a7b056375472

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

Moved orange to Orange (part 2)

Line 
1# Description: Reads a data set, prints out attribute and class names
2# Category:    preprocessing
3# Uses:        imports-85
4# Referenced:  domain.htm
5
6import orange
7
8filename = "imports-85.tab"
9data = orange.ExampleTable(filename)
10print "%s includes %i attributes and a class variable %s" % \
11  (filename, len(data.domain.attributes), data.domain.classVar.name)
12
13print "Attribute names and indices:"
14for i in range(len(data.domain.attributes)):
15  print "(%2d) %-17s" % (i, data.domain.attributes[i].name),
16  if i % 3 == 2: print
Note: See TracBrowser for help on using the repository browser.