Re: [Numpy-discussion] Optimizing multi-tensor contractions in numpy

2015-01-02 Thread Charles R Harris
On Fri, Jan 2, 2015 at 7:45 PM, Daniel Smith wrote: > Hello everyone, > > I have been working on a chunk of code that basically sets out to provide > a single function that can take an arbitrary einsum expression and computes > it in the most optimal way. While np.einsum can compute arbitrary > e

[Numpy-discussion] Optimizing multi-tensor contractions in numpy

2015-01-02 Thread Daniel Smith
Hello everyone, I have been working on a chunk of code that basically sets out to provide a single function that can take an arbitrary einsum expression and computes it in the most optimal way. While np.einsum can compute arbitrary expressions, there are two drawbacks to using pure einsum: eins

[Numpy-discussion] diag, diagonal, ravel and all that

2015-01-02 Thread Charles R Harris
Hi All, The diag, diagonal, and ravel functions have recently been changed to preserve subtypes. However, this causes lots of backward compatibility problems for matrix users, in particular, scipy.sparse. One possibility for fixing this is to special case matrix and so that these functions continu

Re: [Numpy-discussion] Pass 2d ndarray into C **double using ctypes

2015-01-02 Thread Sturla Molden
Yuxiang Wang wrote: > 1) @Strula Sorry about my stupid mistake! That piece of code totally > gave away how green I am in coding C :) Don't worry. C is a high-level assember. It will bite you again and again, it happens to everyone. Those who say they have never made a stupid mistake while coding

Re: [Numpy-discussion] Pass 2d ndarray into C **double using ctypes

2015-01-02 Thread Sturla Molden
Yuxiang Wang wrote: > 4) I wanted to say that it seems to me, as the project gradually > scales up, Cython is easier to deal with, especially when I am using a > lot of numpy arrays. If it is even higher dimensional data, it would > be verbose while it is really succinct to use Cython. The easie

Re: [Numpy-discussion] Extracting required indices from the array of tuples

2015-01-02 Thread Simen Langseth
Dear Jaime: Thank you so much. Your codes are always great. By the way, I have been waiting for several hours to get satisfactory answer at: http://codereview.stackexchange.com/questions/75457/faster-way-of-using-interp1d-in-2d-array?noredirect=1#comment137329_75457 http://stackoverflow.com/ques

Re: [Numpy-discussion] npymath on Windows

2015-01-02 Thread Carl Kleffner
Hi, without further testing; this approach may help: (1) create a shared library with all symbols from libnpymath.a: $ gcc -shared -o libnpymath.dll -Wl,--whole-archive libnpymath.a -Wl,--no-whole-archive -lm (2) create a def file: gendef libnpymath.dll There are now two files created by mings

Re: [Numpy-discussion] Extracting required indices from the array of tuples

2015-01-02 Thread Jaime Fernández del Río
On Fri, Jan 2, 2015 at 3:06 AM, Simen Langseth wrote: > import numpy as np > from scipy import signal > > y = np.array([[2, 1, 2, 3, 2, 0, 1, 0], > [2, 1, 2, 3, 2, 0, 1, 0]]) > > maximas = signal.argrelmax(y, axis=1) > > print maximas > > (array([0, 0, 1, 1], dtype=int64), array([3,

[Numpy-discussion] Extracting required indices from the array of tuples

2015-01-02 Thread Simen Langseth
import numpy as np from scipy import signal y = np.array([[2, 1, 2, 3, 2, 0, 1, 0], [2, 1, 2, 3, 2, 0, 1, 0]]) maximas = signal.argrelmax(y, axis=1) print maximas (array([0, 0, 1, 1], dtype=int64), array([3, 6, 3, 6], dtype=int64)) I want to extract only the first maxima of both

Re: [Numpy-discussion] numpy developers

2015-01-02 Thread Ralf Gommers
On Fri, Jan 2, 2015 at 5:13 AM, Charles R Harris wrote: > Hi All, > > I've invited Alex Griffing onto the team to be a numpy developer. He has > been contributing fixes and reviews for a while and it is time to give him > more opportunity to contribute. I think he will do well. > +1 Ralf __