# [Numpy-discussion] kron bug with zero-length dimensions?

Sven Schreiber svetosch at gmx.net
Thu Jan 25 11:15:38 EST 2007

```Hi,

the kron(a,b) function seems to allow shapes such as (0,x) or (y,0) only
for the second argument b, not for the first argument a. (See below for
examples.)

Maybe it's too harsh to call it a bug because the result is typically
not defined mathematically. But then why differentiate between allowing
those things for b (very useful), but not for a (thus requiring
workarounds.)

Sven

>>> n.kron(n.ones((0,1)), n.ones((1,1)))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/numpy/lib/shape_base.py", line
572, in kron
result = concatenate(result, axis=axis)
ValueError: concatenation of zero-length sequences is impossible
>>> n.kron(n.ones((1,0)), n.ones((1,1)))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/numpy/lib/shape_base.py", line
572, in kron
result = concatenate(result, axis=axis)
ValueError: concatenation of zero-length sequences is impossible
>>> n.kron(n.ones((1,1)), n.ones((0,1)))
array([], shape=(0, 1), dtype=float64)
>>> n.kron(n.ones((1,1)), n.ones((1,0)))
array([], shape=(1, 0), dtype=float64)
>>> n.__version__
'1.0.1'

```