Changes in [9936:08300d990d26:9939:a83d5917f733] in orange
 Location:
 Orange
 Files:

 1 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/misc/__init__.py
r9891 r9938 22 22 23 23 Can be ``SymMatrix.Lower`` (0), ``SymMatrix.Upper`` (1), 24 ``SymMatrix.Symmetric`` (2, default), ``SymMatrix.Lower _Filled`` (3) or24 ``SymMatrix.Symmetric`` (2, default), ``SymMatrix.LowerFilled`` (3) or 25 25 ``SymMatrix.Upper_Filled`` (4). 26 26 27 27 If the matrix type is ``Lower`` or ``Upper``, indexing 28 28 above or below the diagonal, respectively, will fail. 29 With ``Lower _Filled`` and ``Upper_Filled``,29 With ``LowerFilled`` and ``Upper_Filled``, 30 30 the elements upper or lower, respectively, still 31 31 exist and are set to zero, but they cannot be modified. The … … 35 35 If matrix type is ``Upper``, it is printed as: 36 36 37 >>> import Orange 38 >>> m = Orange.misc.SymMatrix( 39 ... [[1], 40 ... [2, 4], 41 ... [3, 6, 9], 42 ... [4, 8, 12, 16]]) 37 43 >>> m.matrix_type = m.Upper 38 44 >>> print m … … 42 48 ( 16.000)) 43 49 44 Changing the type to ``Lower _Filled`` changes the printout to45 46 >>> m.matrix_type = m.Lower _Filled50 Changing the type to ``LowerFilled`` changes the printout to 51 52 >>> m.matrix_type = m.LowerFilled 47 53 >>> print m 48 54 (( 1.000, 0.000, 0.000, 0.000), … … 145 151 if ``m`` is a SymMatrix, then ``m[2, 4]`` addresses the same element as ``m[4, 2]``. 146 152 147 .. literalinclude:: code/symmatrix.py 148 :lines: 16 153 .. 154 .. literalinclude:: code/symmatrix.py 155 :lines: 16 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 149 163 150 164 Although only the lower left half of the matrix was set explicitely, … … 161 175 162 176 >>> print m[1] 163 ( 3.0, 6.0, 9.0, 0.0)177 (2.0, 4.0, 6.0, 8.0) 164 178 >>> m.matrix_type = m.Lower 165 179 >>> for row in m: … … 335 349 >>> for i in range(100): 336 350 ... progress.advance() 337 ... # Or 338 ... progress.set_state(i) 351 ... # Or progress.set_state(i) 339 352 ... time.sleep(0.01) 340 353 ... … … 683 696 """ Return a property object that accesses an attribute named `new_name` 684 697 and raises a deprecation warning when doing so. 698 699 .. 700 701 >>> sys.stderr = sys.stdout 685 702 686 703 Example :: … … 694 711 >>> a = A() 695 712 >>> print a.myAttr 696 __main__:1: DeprecationWarning: 'myAttr' is deprecated. Use 'my_attr' instead!713 ...:1: DeprecationWarning: 'myAttr' is deprecated. Use 'my_attr' instead! 697 714 123 698 715
Note: See TracChangeset
for help on using the changeset viewer.