Changeset 9745:68aab8799638 in orange


Ignore:
Timestamp:
02/06/12 16:09:03 (2 years ago)
Author:
Miha Stajdohar <miha.stajdohar@…>
Branch:
default
rebase_source:
1bf9b9adda31b20ceaf81036887554610c73f00e
Message:

Changed data set path.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/tutorial/rst/code/domain12.py

    r9374 r9745  
    66 
    77import orange 
    8 data = orange.ExampleTable('../../datasets/car') 
     8data = orange.ExampleTable('car.tab') 
    99 
    1010# add attribute price = f(buying, maint) 
    1111# see also http://www.ailab.si/hint/car_dataset.asp 
    1212 
    13 priceTable={} 
     13priceTable = {} 
    1414priceTable['v-high:v-high'] = 'v-high' 
    1515priceTable['high:v-high'] = 'v-high' 
     
    3434price = orange.EnumVariable("price", values=["v-high", "high", "med", "low"]) 
    3535price.getValueFrom = lambda e, getWhat: f(price, e['buying'], e['maint']) 
    36 newdomain = orange.Domain(data.domain.attributes+[price, data.domain.classVar]) 
     36newdomain = orange.Domain(data.domain.attributes + [price, data.domain.classVar]) 
    3737newdata = data.select(newdomain) 
    3838 
     
    4141  print "%10s" % a.name, 
    4242print "%10s" % newdata.domain.classVar.name 
    43 for i in [1,200,300,1200,1700]: 
     43for i in [1, 200, 300, 1200, 1700]: 
    4444  for a in newdata.domain.attributes: 
    4545    print "%10s" % newdata[i][a], 
Note: See TracChangeset for help on using the changeset viewer.