[Numpy-discussion] Shape (z,0)

T J tjhnson at gmail.com
Fri Nov 28 04:50:17 EST 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