Re: [Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray <=> numpy.array typemap to share?

2007-09-06 Thread Christopher Barker
Xavier Gnata wrote: > I'm using the numpy C API (PyArray_SimpleNewFromData) to perform the > conversion but my code is written by hands. I'd like to see that. How are you getting the pointer to pass in to PyArray_SimpleNewFromData? It looks like you can do something like: (VA is a valarray) npy

Re: [Numpy-discussion] corrcoef

2007-09-06 Thread Sven Schreiber
John Hunter schrieb: > Is it desirable that numpy.corrcoef for two arrays returns a 2x2 array > rather than a scalar > > In [10]: npy.corrcoef(npy.random.rand(10), npy.random.rand(10)) > Out[10]: > array([[ 1., -0.16088728], >[-0.16088728, 1.]]) > > > I always end up ext

[Numpy-discussion] corrcoef

2007-09-06 Thread John Hunter
Is it desirable that numpy.corrcoef for two arrays returns a 2x2 array rather than a scalar In [10]: npy.corrcoef(npy.random.rand(10), npy.random.rand(10)) Out[10]: array([[ 1., -0.16088728], [-0.16088728, 1.]]) I always end up extracting the 0,1 element anyway. What is

Re: [Numpy-discussion] 2-d in-place operation performance vs 1-d non in-place

2007-09-06 Thread Timothy Hochberg
On 9/6/07, George Sakkis <[EMAIL PROTECTED]> wrote: > > On Sep 5, 12:29 pm, Francesc Altet <[EMAIL PROTECTED]> wrote: > > A Wednesday 05 September 2007, George Sakkis escrigué: > > > > > > > > > I was surprised to see that an in-place modification of a 2-d array > > > turns out to be slower from th

Re: [Numpy-discussion] 2-d in-place operation performance vs 1-d non in-place

2007-09-06 Thread George Sakkis
On Sep 5, 12:29 pm, Francesc Altet <[EMAIL PROTECTED]> wrote: > A Wednesday 05 September 2007, George Sakkis escrigué: > > > > > I was surprised to see that an in-place modification of a 2-d array > > turns out to be slower from the respective non-mutating operation on > > 1- d arrays, although the

Re: [Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray <=> numpy.array typemap to share?

2007-09-06 Thread Matthieu Brucher
2007/9/5, Christopher Barker <[EMAIL PROTECTED]>: > > Matthieu Brucher wrote: > > Blitz++ is more or less avandoned. It uses indexes than can be > > not-portable between 32bits platforms and 64bits ones. > > Oh well -- that seems remarkably short sited, but would I have done > better? Well, it's