[Numpy-discussion] Setting WRITEABLE flag on array scalar
Thu Jan 10 10:13:36 CST 2008
On Jan 10, 2008 8:53 AM, Stefan van der Walt <email@example.com> wrote:
> Hi all,
> We currently use an array scalar of value False as the mask in
> MaskedArray. I would like to make sure that the mask value cannot be
> modified, but when I try
> import numpy as np
> x = np.bool_(False)
> x.flags['WRITEABLE'] = False
> I am warned that you "Cannot set flags on array scalars.". Is there
> any reason why this is prohibited? Which is the best way around it?
When I try this, the WRITEABLE flag is False to begin with. Are you seeing
it as True? If not it wouldn't seem like there's any reason to do anything
in your case.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion