[Numpy-discussion] array is not writable
David Warde-Farley
dwf@cs.toronto....
Wed Aug 26 23:34:04 CDT 2009
On 26-Aug-09, at 11:49 PM, Mark Wendell wrote:
> Figured this much out: if I do an np.copy of the original array to a
> new array, then I can edit individual 'color' values with impunity. So
> I guess the original array from the pil object still shares memory
> with that image object somehow, making it unwritable?
I'm going to guess that it's because PIL is still responsible for that
memory, not NumPy. I don't really know how this stuff works but
asarray() would just give you a view onto that chunk of memory; since
NumPy didn't allocate it, it probably doesn't want to modify it. Not
sure if you can get away with not making a copy in this situation.
David
More information about the NumPy-Discussion
mailing list