Take a look at numpy.ix_
http://www.scipy.org/Numpy_Example_List_With_Doc#head-603de8bdb62d0412798c45fe1db0648d913c8a9c
This method creates the index array for you. You only have to specify
the coordinates in each dimesion.
Bernhard
On Oct 29, 8:46 am, Matthieu Brucher [EMAIL PROTECTED]
wrote:
Matthieu Brucher matthieu.brucher at gmail.com writes:
But if I have the coordinates of the points in an array, I have to reshape it
and then convert it into a list. Or convert it into a list and then convert it
to a tuple. I know that advanced indexing is useful, but here it is not
coherent.
But if I have the coordinates of the points in an array, I have to
reshape it
and then convert it into a list. Or convert it into a list and then
convert it
to a tuple. I know that advanced indexing is useful, but here it is not
coherent. tuples and lists should have the same result on
Hey,
I was looking at numpy/distutils/ccompiler.py and noticed that it has
a fix for distutils.util.split_quoted.
Here is the relevant code from split_quoted in numpy.distutils.ccompiler:
---
def split_quoted(s):
snip
if
On 10/28/07, Matthieu Brucher [EMAIL PROTECTED] wrote:
Little correction, only c[(2,3)] gives me what I expect, not c[[2,3]],
which
is even stranger.
c[(2,3)] is the same as c[2,3] and obviously works as you expected.
Well, this is not indicated in the documentation.
This is true
In this case the constructor
tuple(arr)
should work just fine.
Sorry, I didn't know it could work (shame on me I should have tested).
--
French PhD student
Website : http://miles.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
I have 2 PCs with 2 different installs:
ActivePython 2.4.3 Build 12 with numpy version '1.0b1'
and
Enthought 2.4.3 (1.0.0 #69) with numpy version '0.9.7.2476'
The attached runs Ok on numpy v1.0, but on Enthought's, print a1[0]
gives:
IndexError: 0-d arrays can't be indexed.
It seems that
I just installed 1.0.3.1 on top of Enthought's and asarray() works.
But...
Although the creation of an array from an address via a Dummy class
is kosher in one process (as in the previous attachment), it fails
across processes - the array is created, but gives a Python has
generated errors
Timothy Hochberg wrote:
On 10/29/07, *Christopher Barker* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
(incidently, the kind of things 'we' are doing seem like the most
simple things to JIT).
Wouldn't a numpy-aware psyco be cool then?
Oh well, I'm not going to