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,
, 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
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
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]:
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