diff options
Diffstat (limited to 'numpy/numarray/functions.py')
-rw-r--r-- | numpy/numarray/functions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/numarray/functions.py b/numpy/numarray/functions.py index 55922e9fe..95738d220 100644 --- a/numpy/numarray/functions.py +++ b/numpy/numarray/functions.py @@ -206,7 +206,7 @@ def fromfile(infile, type=None, shape=None, sizing=STRICT, ##file whose size may be determined before allocation, should be ##quick -- only one allocation will be needed. - recsize = dtype.itemsize * N.product([i for i in shape if i != -1]) + recsize = dtype.itemsize * N.product([i for i in shape if i != -1],axis=0) blocksize = max(_BLOCKSIZE/recsize, 1)*recsize ##try to estimate file size @@ -268,7 +268,7 @@ def fromstring(datastring, type=None, shape=None, typecode=None, dtype=None): if shape is None: count = -1 else: - count = N.product(shape)*dtype.itemsize + count = N.product(shape,axis=0)*dtype.itemsize res = N.fromstring(datastring, count=count) if shape is not None: res.shape = shape |