[Scipy-svn] r3666 - trunk/scipy/sparse
scipy-svn at scipy.org
scipy-svn at scipy.org
Sat Dec 15 15:13:07 EST 2007
Author: wnbell
Date: 2007-12-15 14:12:57 -0600 (Sat, 15 Dec 2007)
New Revision: 3666
Modified:
trunk/scipy/sparse/construct.py
trunk/scipy/sparse/csr.py
Log:
updated spdiags example
Modified: trunk/scipy/sparse/construct.py
===================================================================
--- trunk/scipy/sparse/construct.py 2007-12-15 06:54:42 UTC (rev 3665)
+++ trunk/scipy/sparse/construct.py 2007-12-15 20:12:57 UTC (rev 3666)
@@ -37,13 +37,13 @@
*Example*
-------
-
- >>> diags = array([[1,2,3],[4,5,6],[7,8,9]])
+ >>> diags = array([[1,2,3,4]]).repeat(3,axis=0)
>>> offsets = array([0,-1,2])
- >>> spdiags( diags, offsets, 3, 5).todense()
- matrix([[ 1., 0., 7., 0., 0.],
- [ 4., 2., 0., 8., 0.],
- [ 0., 5., 3., 0., 9.]])
+ >>> spdiags(diags,offsets,4,4).todense()
+ matrix([[1, 0, 3, 0],
+ [1, 2, 0, 4],
+ [0, 2, 3, 0],
+ [0, 0, 3, 4]])
"""
#TODO update this example
Modified: trunk/scipy/sparse/csr.py
===================================================================
--- trunk/scipy/sparse/csr.py 2007-12-15 06:54:42 UTC (rev 3665)
+++ trunk/scipy/sparse/csr.py 2007-12-15 20:12:57 UTC (rev 3666)
@@ -51,6 +51,7 @@
return _cs_matrix._transpose(self, csc_matrix, copy)
def __getitem__(self, key):
+ #TODO unify these in _cs_matrix
if isinstance(key, tuple):
row = key[0]
col = key[1]
More information about the Scipy-svn
mailing list