[Numpy-svn] r3558 - trunk/numpy/numarray

numpy-svn@scip... numpy-svn@scip...
Tue Feb 27 22:13:33 CST 2007


Author: oliphant
Date: 2007-02-27 22:13:31 -0600 (Tue, 27 Feb 2007)
New Revision: 3558

Modified:
   trunk/numpy/numarray/functions.py
Log:
Fix numarray.fromstring

Modified: trunk/numpy/numarray/functions.py
===================================================================
--- trunk/numpy/numarray/functions.py	2007-02-28 04:01:10 UTC (rev 3557)
+++ trunk/numpy/numarray/functions.py	2007-02-28 04:13:31 UTC (rev 3558)
@@ -270,8 +270,8 @@
     if shape is None:
         count = -1
     else:
-        count = N.product(shape)*dtype.itemsize
-    res = N.fromstring(datastring, count=count)
+        count = N.product(shape)
+    res = N.fromstring(datastring, dtype=dtype, count=count)
     if shape is not None:
         res.shape = shape
     return res



More information about the Numpy-svn mailing list