From 775a47de7e2f4b039592d614e7ac3fda464975a8 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 29 Aug 2006 10:28:11 +0000 Subject: Add axis arguments to various functions so as not to rely on the defaults. --- numpy/numarray/functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/numarray/functions.py') 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 -- cgit v1.2.1