[Numpy-discussion] Shape (z,0)

T J tjhnson@gmail....
Fri Nov 28 03:50:17 CST 2008


>>> import numpy as np
>>> x = np.ones((3,0))
>>> x
array([], shape(3,0), dtype=float64)

To preempt, I'm not really concerned with the answer to:  Why would
anyone want to do this?

I just want to know what is happening.  Especially, with

>>> x[0,:] = 5

(which works).  It seems that nothing is really happening here...given
that, why is it allowed? Ie, are there reasons for not requiring the
shape dimensions to be greater than 0?


More information about the Numpy-discussion mailing list