Ignore:
Location:
Orange
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/misc/__init__.py

    r9891 r9938  
    2222 
    2323        Can be ``SymMatrix.Lower`` (0), ``SymMatrix.Upper`` (1),  
    24         ``SymMatrix.Symmetric`` (2, default), ``SymMatrix.Lower_Filled`` (3) or 
     24        ``SymMatrix.Symmetric`` (2, default), ``SymMatrix.LowerFilled`` (3) or 
    2525        ``SymMatrix.Upper_Filled`` (4).  
    2626 
    2727        If the matrix type is ``Lower`` or ``Upper``, indexing  
    2828        above or below the diagonal, respectively, will fail.  
    29         With ``Lower_Filled`` and ``Upper_Filled``, 
     29        With ``LowerFilled`` and ``Upper_Filled``, 
    3030        the elements upper or lower, respectively, still  
    3131        exist and are set to zero, but they cannot be modified. The  
     
    3535        If matrix type is ``Upper``, it is printed as: 
    3636 
     37        >>> import Orange 
     38        >>> m = Orange.misc.SymMatrix( 
     39        ...     [[1],  
     40        ...      [2, 4],  
     41        ...      [3, 6, 9],  
     42        ...      [4, 8, 12, 16]]) 
    3743        >>> m.matrix_type = m.Upper 
    3844        >>> print m 
     
    4248         (                        16.000)) 
    4349 
    44         Changing the type to ``Lower_Filled`` changes the printout to 
    45  
    46         >>> m.matrix_type = m.Lower_Filled 
     50        Changing the type to ``LowerFilled`` changes the printout to 
     51 
     52        >>> m.matrix_type = m.LowerFilled 
    4753        >>> print m 
    4854        (( 1.000,  0.000,  0.000,  0.000), 
     
    145151if ``m`` is a SymMatrix, then ``m[2, 4]`` addresses the same element as ``m[4, 2]``. 
    146152 
    147 .. literalinclude:: code/symmatrix.py 
    148     :lines: 1-6 
     153.. 
     154    .. literalinclude:: code/symmatrix.py 
     155        :lines: 1-6 
     156 
     157>>> import Orange 
     158>>> m = Orange.misc.SymMatrix(4) 
     159>>> for i in range(4): 
     160...    for j in range(i+1): 
     161...        m[i, j] = (i+1)*(j+1) 
     162 
    149163 
    150164Although only the lower left half of the matrix was set explicitely,  
     
    161175 
    162176>>> print m[1] 
    163 (3.0, 6.0, 9.0, 0.0) 
     177(2.0, 4.0, 6.0, 8.0) 
    164178>>> m.matrix_type = m.Lower 
    165179>>> for row in m: 
     
    335349        >>> for i in range(100): 
    336350        ...    progress.advance() 
    337         ...    # Or 
    338         ...    progress.set_state(i) 
     351        ...    # Or progress.set_state(i) 
    339352        ...    time.sleep(0.01) 
    340353        ... 
     
    683696    """ Return a property object that accesses an attribute named `new_name` 
    684697    and raises a deprecation warning when doing so. 
     698 
     699    .. 
     700 
     701        >>> sys.stderr = sys.stdout 
    685702     
    686703    Example :: 
     
    694711        >>> a = A() 
    695712        >>> print a.myAttr 
    696         __main__:1: DeprecationWarning: 'myAttr' is deprecated. Use 'my_attr' instead! 
     713        ...:1: DeprecationWarning: 'myAttr' is deprecated. Use 'my_attr' instead! 
    697714        123 
    698715         
Note: See TracChangeset for help on using the changeset viewer.