Re: [Tutor] change values in an array

2011-11-17 Thread Peter Otten
questions anon wrote: > I am trying to do something really simple. > I have a numpy array and if any values in the array are 255 I want to > change them to 1. > but I can't seem to get anything to work! Note that numpy is a specialist topic, and for everything but the basics the numpy mailing li

[Tutor] change values in an array

2011-11-16 Thread questions anon
I am trying to do something really simple. I have a numpy array and if any values in the array are 255 I want to change them to 1. but I can't seem to get anything to work! If I use: for i, value in enumerate(mask_arr): if value==255: mask_arr[i]=1 I get this error: Traceback (most