[Numpy-discussion] Why is the shape of a singleton array the empty tuple?

Ian Mallett geometrian@gmail....
Sat Mar 6 23:37:04 CST 2010


>>> x = numpy.array(3)
>>> x
array(3)
>>> x.shape
()
>>> y = numpy.array([3])
>>> y
array([3])
>>> y.shape
(1,)

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100306/140b7646/attachment.html 


More information about the NumPy-Discussion mailing list