Re: [Tutor] reclassify values in an array

2011-09-04 Thread questions anon
Thanks all, that helped me work out that I needed to try something else. If anyone else needs to know what method worked: big_array=N.ma.concatenate(all_FFDI) for x in N.nditer(big_array, op_flags=['readwrite']): if x<100: x[...]=x=0 elif x>=100: x[...]=x=1 sum=big_array.su

Re: [Tutor] reclassify values in an array

2011-09-02 Thread Andre' Walker-Loud
> thank you for all of the resonses, I have attempted all of the suggestions. > It is a numpy array so I can try another list if you would prefer but I > thought I would show the error anyway. > the error I am receiving is > ValueError: The truth value of an array with more than one element is

Re: [Tutor] reclassify values in an array

2011-09-02 Thread questions anon
thank you for all of the resonses, I have attempted all of the suggestions. It is a numpy array so I can try another list if you would prefer but I thought I would show the error anyway. the error I am receiving is ValueError: The truth value of an array with more than one element is ambiguous. Use

Re: [Tutor] reclassify values in an array

2011-09-01 Thread Peter Otten
questions anon wrote: > I have been going round in circles trying to solve something that sounds > simple. I have a huge array and I would like to reclassify the values. > Firstly just make them zeros and ones, for example if the values in the > array are less than 100 make them 0 and if greater t

Re: [Tutor] reclassify values in an array

2011-09-01 Thread Sander Sweers
On Thu,  1 Sep 2011, 01:17:45 CEST, questions anon wrote: > Firstly just make them zeros and ones, for example if the values in the > array are less than 100 make them 0 and if greater than 100 make them 1. > And then finally sum them together. > I have attempted a few methods, see code below.

Re: [Tutor] reclassify values in an array

2011-08-31 Thread Andre' Walker-Loud
Hi anonymous questioner, Like Alan, I suspect you are using numpy as import numpy as N there is probably a numpy email list where this would be more appropriate (personally I don't object, but I don't want to speak for all the subscribers). the 2nd attempt is closer to the right answer. To he

Re: [Tutor] reclassify values in an array

2011-08-31 Thread Alan Gauld
On 01/09/11 00:17, questions anon wrote: Dear All, I have been going round in circles trying to solve something that sounds simple. I have a huge array and I would like to reclassify the values. Firstly just make them zeros and ones,... And then finally sum them together. And what has been the

[Tutor] reclassify values in an array

2011-08-31 Thread questions anon
Dear All, I have been going round in circles trying to solve something that sounds simple. I have a huge array and I would like to reclassify the values. Firstly just make them zeros and ones, for example if the values in the array are less than 100 make them 0 and if greater than 100 make them 1.