[Scipy-svn] r2924 - trunk/Lib/io

scipy-svn@scip... scipy-svn@scip...
Mon Apr 16 10:51:30 CDT 2007


Author: wnbell
Date: 2007-04-16 10:51:28 -0500 (Mon, 16 Apr 2007)
New Revision: 2924

Modified:
   trunk/Lib/io/mio4.py
Log:
Fixed the following error that occurs when storing rank > 2 tensors:

/usr/lib/python2.4/site-packages/scipy/io/mio4.py in arr_to_2d(self)
    242         if len(dims) > 2:
    243             dims = [N.product(dims[:-1]), dims[-1]]
--> 244             self.arr = reshape(self.arr, dims)
    245             
    246     def write(self):

NameError: global name 'reshape' is not defined




Modified: trunk/Lib/io/mio4.py
===================================================================
--- trunk/Lib/io/mio4.py	2007-04-15 15:34:44 UTC (rev 2923)
+++ trunk/Lib/io/mio4.py	2007-04-16 15:51:28 UTC (rev 2924)
@@ -240,8 +240,7 @@
         self.arr = N.atleast_2d(self.arr)
         dims = self.arr.shape
         if len(dims) > 2:
-            dims = [N.product(dims[:-1]), dims[-1]]
-            self.arr = reshape(self.arr, dims)
+            self.arr = self.arr.reshape(-1,dims[-1])
             
     def write(self):
         assert False, 'Not implemented'



More information about the Scipy-svn mailing list