source: orange/docs/tutorial/rst/code/data-domain1.py @ 11052:c22077a09e63

Revision 11052:c22077a09e63, 618 bytes checked in by blaz <blaz.zupan@…>, 16 months ago (diff)

new tutorial

Line 
1import Orange
2
3data = Orange.data.Table("imports-85.tab")
4m = len(data.domain.features)
5m_cont = sum(1 for x in data.domain.features if x.var_type==Orange.feature.Type.Continuous)
6m_disc = sum(1 for x in data.domain.features if x.var_type==Orange.feature.Type.Discrete)
7m_disc = len(data.domain.features)
8print "%d features, %d continuous and %d discrete" % (m, m_cont, m-m_cont)
9
10print "First three features:"
11for i in range(3):
12    print "   ", data.domain.features[i].name
13
14print "First three features (again):"
15for x in data.domain.features[:3]:
16    print "   ", x.name
17
18print "Class:", data.domain.class_var.name
Note: See TracBrowser for help on using the repository browser.