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

Ian Mallett geometrian at gmail.com
Sun Mar 7 00:37:04 EST 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.python.org/pipermail/numpy-discussion/attachments/20100306/140b7646/attachment.html>


More information about the NumPy-Discussion mailing list