[Numpy-discussion] numpy ndenumerate

2012-02-26 Thread Nathan Faggian
Hi, Is there a good reason for ndenumerate in numpy being slower than standard indexing? For example: --- import numpy as np def fast_itt(a): for index, value in np.ndenumerate(a): a[index] += 1 def slow_itt(a): for r in range(0, a.shape[0]): for c in range(0,

Re: [Numpy-discussion] Negative indexing.

2012-01-16 Thread Nathan Faggian
, Nathan Faggian nathan.fagg...@gmail.com wrote: Hi, I am finding it less than useful to have the negative index wrapping on nd-arrays. Here is a short example: import numpy as np a = np.zeros((3, 3)) a[:,2] = 1000 print a[0,-1] print a[0,-1] print a[-1,-1] In all cases 1000 is printed

[Numpy-discussion] Negative indexing.

2012-01-14 Thread Nathan Faggian
Hi, I am finding it less than useful to have the negative index wrapping on nd-arrays. Here is a short example: import numpy as np a = np.zeros((3, 3)) a[:,2] = 1000 print a[0,-1] print a[0,-1] print a[-1,-1] In all cases 1000 is printed out. What I am after is a way to say please don't wrap

[Numpy-discussion] Using dtype=object

2011-11-14 Thread Nathan Faggian
Hi, I am interested in the use of numpy with native python objects, like so: In [91]: import collections In [92]: testContainer = collections.namedtuple('testContainer', 'att1 att2 att3') In [93]: test1 = testContainer(1, 2, 3) In [94]: test2 = testContainer(4, 5, 6) In [95]: test1 Out[95]:

[Numpy-discussion] Construct a large n-dimensional complex matrix

2009-04-06 Thread Nathan Faggian
HI, I want to construct a large complex matrix, I have the real and imaginary components as double vectors, is there a fast way to construct a complex vector in numpy? Cheers, Nathan. Nathan Faggian, Ph.D