import numpy as np
a = np.arange(10)
flags = a.flags
flags
C_CONTIGUOUS : True
F_CONTIGUOUS : True
OWNDATA : True
WRITEABLE : True
ALIGNED : True
UPDATEIFCOPY : False
flags.writeable = False
a.flags
C_CONTIGUOUS : True
F_CONTIGUOUS : True
OWNDATA : True
WRITEABLE : False
Ah, *that* example is surprising to me. Regardless of whether it is a C int
of the PyArrayObject struct or not, the way it is presented at the python
code level should make sense. From my perspective, a.flags is a mutable
object of some sort. Updating it should act like a mutable object, not some
I fail to see the wtf.
flags = a.flags
So, flags at this point is just an alias to a.flags, just like any
other variable in python
flags.writeable = False would then be equivalent to a.flags.writeable =
False. There is nothing numpy-specific here. a.flags is mutable object.
This is how Python
On Wed, Mar 25, 2015 at 1:45 PM, Benjamin Root ben.r...@ou.edu wrote:
I fail to see the wtf.
flags = a.flags
So, flags at this point is just an alias to a.flags, just like any
other variable in python
flags.writeable = False would then be equivalent to a.flags.writeable =
False. There