Changeset 9984:e6a829654b3e in orange


Ignore:
Timestamp:
02/07/12 21:52:02 (2 years ago)
Author:
Miha Stajdohar <miha.stajdohar@…>
Branch:
default
Message:

Fixed a typo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/code/datatable1.py

    r9945 r9984  
    1010values = ["1", "2", "3", "4"] 
    1111 
    12 features = [Orange.feature.Discrete(name, values = values[:card]) 
     12features = [Orange.feature.Discrete(name, values=values[:card]) 
    1313              for name, card in zip("abcdef", cards)] 
    14 classattr = Orange.feature.Discrete("y", values = ["0", "1"]) 
     14classattr = Orange.feature.Discrete("y", values=["0", "1"]) 
    1515domain = Orange.data.Domain(features + [classattr]) 
    1616data = Orange.data.Table(domain) 
     
    2020 
    2121for i in range(5): 
    22     inst = [random.randint(0, c-1) for c in card] 
    23     inst.append(inst[0]==inst[1] or inst[4]==0) 
     22    inst = [random.randint(0, c - 1) for c in cards] 
     23    inst.append(inst[0] == inst[1] or inst[4] == 0) 
    2424    data.append(inst) 
    2525 
     
    2727    print inst 
    2828 
    29 loe = [["3", "1", "1", "2", "1", "1",  "1"], 
    30        ["3", "1", "1", "2", "2", "1",  "0"], 
    31        ["3", "3", "1", "2", "2", "1",  "1"] 
     29loe = [["3", "1", "1", "2", "1", "1", "1"], 
     30       ["3", "1", "1", "2", "2", "1", "0"], 
     31       ["3", "3", "1", "2", "2", "1", "1"] 
    3232      ] 
    3333 
     
    3737 
    3838import numpy 
    39 d = Orange.data.Domain([Orange.feature.Continuous('a%i'%x) for x in range(5)]) 
     39d = Orange.data.Domain([Orange.feature.Continuous('a%i' % x) for x in range(5)]) 
    4040a = numpy.array([[1, 2, 3, 4, 5], [5, 4, 3, 2, 1]]) 
    4141t = Orange.data.Table(a) 
Note: See TracChangeset for help on using the changeset viewer.