[Numpy-discussion] Re place array values

2012-03-14 Thread jonasr
Hello, my problem is that i want to remove some small numbers of an 2d array, for example if i want to sort out all numbers smaller then 1 of an array i get x=[[0,1,2],[3,4,5][6,7,8]] c=x>=1 In [213]: c Out[213]: array([[False, True, True], [ True, True, True], [ True, Tru

[Numpy-discussion] build numpy matrix out of smaller matrix

2011-12-01 Thread jonasr
Hi, is there any possibility to define a numpy matrix, via a smaller given matrix, i.e. in matlab i can do this like a=[1 2 ; 3 4 ] A=[a a ; a a ] so that i finally get A=[ [1,2,1,2] [3,4,3,4] [1,2,1,2] [3,4,3,4]] i tried different things on numpy which didn't work

Re: [Numpy-discussion] numpy function error

2011-06-10 Thread jonasr
ooh , my bad your right didnt see that thank you Olivier Delalleau-2 wrote: > > You are overriding your f1 function with a float (with > "f1=f1(self.ptdata[i])"), so trying to call f1(xul) later will raise this > exception. > > -=- Olivier > > 2011/6/10

[Numpy-discussion] numpy function error

2011-06-10 Thread jonasr
Hello, i have the following problem, the following code doesnt work def f1(x): return self.lgdata[2*i][0]*float(x)+self.lgdata[2*i][1] def f2(x): return self.lgdata[2*i+1][0]*float(x)+self.lgdata[2*i+1][1] f1=f1(self.ptdata[i]) f2=f2(self.ptdata[i]) t=abs(f1-f2) deltat.append(t) temptot.append(f1

[Numpy-discussion] numpy function error

2011-06-10 Thread jonasr
Hello, i have the following problem, the following code doesnt work def f1(x): return self.lgdata[2*i][0]*float(x)+self.lgdata[2*i][1] def f2(x): return self.lgdata[2*i+1][0]*float(x)+self.lgdata[2*i+1][1] f1=f1(self.ptdata[i]) 2=f2(self.ptdata[i]) t=abs(f1-f2) deltat.append(t) temptot.append(f1)

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread jonasr
Bruce Southey wrote: > > On 06/03/2011 09:33 AM, jonasr wrote: >> thank you very much, works much nicer and faster in comparison to the >> script >> i wrote and used before , >> im not that much used to lambda forms but it seems quit usefull in >> s

Re: [Numpy-discussion] numpy input with genfromttxt()

2011-06-03 Thread jonasr
thank you very much, works quit nice and faster in comparison to the script i wrote and used before , im not that much used to lambda forms but it seems quit usefull in situations like this Olivier Delalleau-2 wrote: > > Here's an ugly one-liner: > > numpy.genfromtxt('data.txt', converters=d