diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2007-07-10 16:10:25 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2007-07-10 16:10:25 +0000 |
commit | 18bc84c2799e7a476c4ed6620e7a36bc055fe6af (patch) | |
tree | 9ff16b2dafb51beaa4f7fb2af57bbd83cb1fd08b /numpy/lib/shape_base.py | |
parent | e02d2e27677b932b90510b1b00d63d58b39e7ac4 (diff) | |
download | numpy-18bc84c2799e7a476c4ed6620e7a36bc055fe6af.tar.gz |
Tile empty arrays.
Diffstat (limited to 'numpy/lib/shape_base.py')
-rw-r--r-- | numpy/lib/shape_base.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |