From 18bc84c2799e7a476c4ed6620e7a36bc055fe6af Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Tue, 10 Jul 2007 16:10:25 +0000 Subject: Tile empty arrays. --- numpy/lib/shape_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/shape_base.py') diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index 2f9ecfa26..95b2bf2ce 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -620,7 +620,7 @@ def tile(A, reps): d = len(tup) c = _nx.array(A,copy=False,subok=True,ndmin=d) shape = list(c.shape) - n = c.size + n = max(c.size,1) if (d < c.ndim): tup = (1,)*(c.ndim-d) + tup for i, nrep in enumerate(tup): @@ -629,5 +629,5 @@ def tile(A, reps): dim_in = shape[i] dim_out = dim_in*nrep shape[i] = dim_out - n /= dim_in + n /= max(dim_in,1) return c.reshape(shape) -- cgit v1.2.1