Re: [Numpy-discussion] Smart way to do this?

2013-02-22 Thread santhu kumar
Sorry typo : a = np.ones(30) idx = np.array([2,3,2]) # there is a duplicate index of 2 a[idx] += 2 On Fri, Feb 22, 2013 at 8:35 PM, santhu kumar wrote: > Hi all, > > I dont want to run a loop for this but it should be possible using numpy > "smart" ways. > > a =

[Numpy-discussion] Smart way to do this?

2013-02-22 Thread santhu kumar
Hi all, I dont want to run a loop for this but it should be possible using numpy "smart" ways. a = np.ones(30) idx = np.array([2,3,2]) # there is a duplicate index of 2 a += 2 >>>a array([ 1., 1., 3., 3., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,

[Numpy-discussion] Help with python in C code

2013-02-12 Thread santhu kumar
Hello all, I was able to successfully embed python code into C code. The basic skeleton is something like this : In C code : PyObject *pName, *pModule, *pFunc,*pArgs,*pReturn; PyArrayObject *cusForce; Py_Initialize(); import_array(); // required while using numpy arrays in C // Call some

Re: [Numpy-discussion] Numpy multiple instances

2013-01-28 Thread santhu kumar
Please ignore the previous message. I have done some testing and found it to be running on a client node instead of the master node. The problem might be because node2, does not have numpy installed. Thanks. ___ NumPy-Discussion mailing list NumPy-Discus

[Numpy-discussion] Numpy multiple instances

2013-01-28 Thread santhu kumar
Hello, I have embedded python/numpy scripts in an application that runs in parallel. But the python code is always invoked on the master node. So it could be assumed that at some point, there could be multiple instances of script being invoked and run. I have commented out import numpy part to se

[Numpy-discussion] partial computations

2012-04-11 Thread santhu kumar
Hello all, I am trying to optimise a code and want your suggestions. A : - NX3 matrix (coordinates of N points) After performing pairwise distance computations(called pdist) between these points, depending upon a condition that the distance is in, I would perform further computations. Most of the

Re: [Numpy-discussion] Trick for fast

2012-02-03 Thread santhu kumar
py-discussion-requ...@scipy.org > > You can reach the person managing the list at >numpy-discussion-ow...@scipy.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of NumPy-Discussion digest..." > > > Today'

Re: [Numpy-discussion] Trick for fast

2012-02-03 Thread santhu kumar
Message: 1 > Date: Fri, 3 Feb 2012 09:10:28 -0500 > From: josef.p...@gmail.com > Subject: Re: [Numpy-discussion] Trick for fast > To: Discussion of Numerical Python > Message-ID: > > > Content-Type: text/plain; charset=ISO-8859-1 > > On Fri, Feb 3, 2012 at 8:44 AM

[Numpy-discussion] Trick for fast

2012-02-03 Thread santhu kumar
Hello all, I have tried to optimize most of my code but this ones seems to be the major bottleneck as it gets called many times. I have run out of ideas to make it more faster, can somebody please help me here. x = nX3 vector. mass = nX1 vector inert = zeros((3,3)) for i in range(n): ri = x

Re: [Numpy-discussion] SVD does not converge

2011-06-28 Thread santhu kumar
x27; to >numpy-discussion-requ...@scipy.org > > You can reach the person managing the list at >numpy-discussion-ow...@scipy.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of NumPy-Discussion digest..." &g

[Numpy-discussion] SVD does not converge

2011-06-28 Thread santhu kumar
Hello, I have a 380X5 matrix and when I am calculating pseudo-inverse of the matrix using pinv(numpy.linalg) I get the following error message: raise LinAlgError, 'SVD did not converge' numpy.linalg.linalg.LinAlgError: SVD did not converge I have looked in the list that it is a recurring issue b

[Numpy-discussion] Extending dimensions of a matrix

2011-05-26 Thread santhu kumar
Hello All, I am trying to extend a piece of matlab code into numpy. And I am stuck at converting, ( x is a nX3 matrix) Matlab : dim = size(x,1) % would be n nx = x(:,:,ones(1,dim)) % would be nX3Xn matrix .. Now the same in Numpy seems to be tricky to me .. Can somebody help me in writing this p

Re: [Numpy-discussion] Nonzero behaving strangely?

2011-03-17 Thread santhu kumar
hment was scrubbed... > URL: > http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110317/2f46f2c1/attachment-0001.html > > -- > > Message: 2 > Date: Thu, 17 Mar 2011 23:19:42 +0100 > From: Matthieu Brucher > Subject: Re: [Numpy-disc

[Numpy-discussion] Nonzero behaving strangely?

2011-03-17 Thread santhu kumar
Hello all, I am new to Numpy. I used to program before in matlab and am getting used to Numpy. I have a array like: res array([[ 33.35053669, 49.4615004 , 44.27631299, 1., 2. ], [ 32.84263059, 50.24752036, 43.92291659, 1., 0. ], [ 33.68999668, 48.9055467