Changeset 9526:cc86517bcbb0 in orange


Ignore:
Timestamp:
01/09/12 21:03:45 (2 years ago)
Author:
markotoplak
Branch:
default
Convert:
43afcff911bdd44e1ab1825598d7dcf7b067bc06
Message:

fixed Distribution example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/statistics/distribution.py

    r9357 r9526  
    44============= 
    55 
    6 Class :obj:`Distribution` and derived classes are used for storing empirical 
     6:obj:`Distribution` and derived classes store empirical 
    77distributions of discrete and continuous variables. 
    88 
    99.. class:: Distribution 
    1010 
    11     A base class for storing distributions of variable values. The class can 
    12     store absolute or relative frequencies. Provides a convenience constructor 
     11    This class can 
     12    store absolute or relative frequencies. It provides a convenience constructor 
    1313    which constructs instances of derived classes. :: 
    1414 
     
    353353    dist = Orange.statistics.distribution.Domain(data) 
    354354 
    355         for d in dist: 
    356             if d.variable.varType == orange.VarTypes.Discrete: 
    357                  print "%30s: %s" % (d.variable.name, d) 
    358             else: 
    359                  print "%30s: avg. %5.3f" % (d.variable.name, d.average()) 
     355    for d in dist: 
     356        if d.variable.var_type == Orange.data.Type.Discrete: 
     357             print "%30s: %s" % (d.variable.name, d) 
     358        else: 
     359             print "%30s: avg. %5.3f" % (d.variable.name, d.average()) 
    360360 
    361361The distribution for, say, attribute `age` can be obtained by its index and also 
Note: See TracChangeset for help on using the changeset viewer.