[Scipy-svn] r3913 - trunk/scipy/sparse

scipy-svn at scipy.org scipy-svn at scipy.org
Mon Feb 11 08:46:31 EST 2008


Author: wnbell
Date: 2008-02-11 07:46:25 -0600 (Mon, 11 Feb 2008)
New Revision: 3913

Modified:
   trunk/scipy/sparse/base.py
Log:
fixed str(sparse) output


Modified: trunk/scipy/sparse/base.py
===================================================================
--- trunk/scipy/sparse/base.py	2008-02-10 22:52:55 UTC (rev 3912)
+++ trunk/scipy/sparse/base.py	2008-02-11 13:46:25 UTC (rev 3913)
@@ -144,6 +144,7 @@
     def getdata(self, num):
         return None
 
+    @deprecate
     def listprint(self, start, stop):
         """Provides a way to print over a single index.
         """
@@ -171,12 +172,13 @@
         if nnz > maxprint:
             half = maxprint // 2 
             out  = tostr(A.row[:half], A.col[:half], A.data[:half])
-            out +=  + "  :\t:\n"
-            out += tostr(A.row[:-half], A.col[:-half], A.data[:-half])
+            out += "\n  :\t:\n"
+            half = maxprint - maxprint//2 
+            out += tostr(A.row[-half:], A.col[-half:], A.data[-half:])
         else:
             out  = tostr(A.row, A.col, A.data)
 
-        return out[:-1]
+        return out
 
     def __nonzero__(self):  # Simple -- other ideas?
         return self.getnnz() > 0




More information about the Scipy-svn mailing list