[Numpy-discussion] Using np.partition to extract n largest/smallest items from an array

2013-12-12 Thread Jaime Fernández del Río
With the new np.partition functionality, there is a more efficient, but also less obvious, way of extracting the n largest (or smallest) elements from an array, i.e.: def smallest_n(a, n): return np.sort(np.partition(a, n)[:n]) def argsmallest_n(a, n): ret = np.argpartition(a, n)[:n]

Re: [Numpy-discussion] building 32 bit numpy on 64 bit linux

2013-12-12 Thread Julian Taylor
On 12.12.2013 20:40, David Jones wrote: > On 12/12/13 15:54, Julian Taylor wrote: >> On 12.12.2013 19:58, David Jones wrote: >>> I'm trying to compile 32-bit numpy on a 64 bit Centos 6 system, but fails >>> with the message: >>> >>> "Broken toolchain: cannot link a simple C program" >>> ... >>> >>

Re: [Numpy-discussion] building 32 bit numpy on 64 bit linux

2013-12-12 Thread David Jones
On 12/12/13 15:54, Julian Taylor wrote: > On 12.12.2013 19:58, David Jones wrote: >> I'm trying to compile 32-bit numpy on a 64 bit Centos 6 system, but fails >> with the message: >> >> "Broken toolchain: cannot link a simple C program" >> >> It get's the compile flags right, but not the linker: >

Re: [Numpy-discussion] building 32 bit numpy on 64 bit linux

2013-12-12 Thread Julian Taylor
On 12.12.2013 19:58, David Jones wrote: > I'm trying to compile 32-bit numpy on a 64 bit Centos 6 system, but fails > with the message: > > "Broken toolchain: cannot link a simple C program" > > It get's the compile flags right, but not the linker: > > C compiler: gcc -pthread -fno-strict-alias

[Numpy-discussion] building 32 bit numpy on 64 bit linux

2013-12-12 Thread David Jones
I'm trying to compile 32-bit numpy on a 64 bit Centos 6 system, but fails with the message: "Broken toolchain: cannot link a simple C program" It get's the compile flags right, but not the linker: C compiler: gcc -pthread -fno-strict-aliasing -g -O2 -m32 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-

[Numpy-discussion] repeat array in a fake dim without stride_tricks ?

2013-12-12 Thread Pierre Haessig
Hello, In order to repeat rows or columns of an array as http://stackoverflow.com/questions/1550130/cloning-row-or-column-vectors I can use np.repeat as suggested by pv. However, looking at the flags of the resulting array, data seems to be copied and actually repeated in memory. This is not appli