Re: [Numpy-discussion] numpythonically getting elements with the minimum sum

2013-01-29 Thread Gregor Thalhammer
Am 28.1.2013 um 23:15 schrieb Lluís: Hi, I have a somewhat convoluted N-dimensional array that contains information of a set of experiments. The last dimension has as many entries as iterations in the experiment (an iterative application), and the penultimate dimension has as many

[Numpy-discussion] Question about documentation for SWIG and ctypes numpy support

2013-01-29 Thread Valentin Haenel
Hi, I need to link the documentation on ctypes and SWIG support for Numpy. For ctypes I found: http://www.scipy.org/Cookbook/Ctypes Which seems to be reasonably up-to-date. There are of course also: http://docs.scipy.org/doc/numpy/reference/routines.ctypeslib.html There are also the

[Numpy-discussion] np.where: x and y need to have the same shape as condition ?

2013-01-29 Thread denis
Folks, the doc for `where` says x and y need to have the same shape as condition http://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.where.html But surely where is equivalent to: [xv if c else yv for (c,xv,yv) in zip(condition,x,y)] holds as long as len(condition) == len(x) ==

Re: [Numpy-discussion] numpythonically getting elements with the minimum sum

2013-01-29 Thread Lluís
Gregor Thalhammer writes: Am 28.1.2013 um 23:15 schrieb Lluís: Hi, I have a somewhat convoluted N-dimensional array that contains information of a set of experiments. The last dimension has as many entries as iterations in the experiment (an iterative application), and the

Re: [Numpy-discussion] numpythonically getting elements with the minimum sum

2013-01-29 Thread Sebastian Berg
On Tue, 2013-01-29 at 14:53 +0100, Lluís wrote: Gregor Thalhammer writes: Am 28.1.2013 um 23:15 schrieb Lluís: Hi, I have a somewhat convoluted N-dimensional array that contains information of a set of experiments. The last dimension has as many entries as iterations in the

Re: [Numpy-discussion] numpythonically getting elements with the minimum sum

2013-01-29 Thread Lluís
Sebastian Berg writes: On Tue, 2013-01-29 at 14:53 +0100, Lluís wrote: Gregor Thalhammer writes: Am 28.1.2013 um 23:15 schrieb Lluís: Hi, I have a somewhat convoluted N-dimensional array that contains information of a set of experiments. The last dimension has as many

Re: [Numpy-discussion] numpythonically getting elements with the minimum sum

2013-01-29 Thread Lluís
Lluís writes: Sebastian Berg writes: On Tue, 2013-01-29 at 14:53 +0100, Lluís wrote: Gregor Thalhammer writes: Am 28.1.2013 um 23:15 schrieb Lluís: Hi, I have a somewhat convoluted N-dimensional array that contains information of a set of experiments. The last dimension

Re: [Numpy-discussion] np.where: x and y need to have the same shape as condition ?

2013-01-29 Thread Benjamin Root
On Tue, Jan 29, 2013 at 6:16 AM, denis denis-bz...@t-online.de wrote: Folks, the doc for `where` says x and y need to have the same shape as condition http://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.where.html But surely where is equivalent to: [xv if c else yv for