[Numpy-discussion] When are 0-d arrays writeable?

Charles R Harris charlesr.harris@gmail....
Thu Nov 22 21:34:27 CST 2012


Examples,

In [13]: ones(()).flags.writeable
Out[13]: True

In [14]: (-ones(())).flags.writeable
Out[14]: False

In [15]: (-1*ones(())).flags.writeable
Out[15]: False

In [16]: (1 + ones(())).flags.writeable
Out[16]: False

In [17]: array(1)
Out[17]: array(1)

In [18]: array(1).shape
Out[18]: ()

In [19]: array(1).flags.writeable
Out[19]: True


Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20121122/b32f3811/attachment.html 


More information about the NumPy-Discussion mailing list