[Numpy-discussion] embeding numpy in c++

2013-02-27 Thread Sunghwan Choi
Hi, I am now trying to embedding numpy in my c++ code (more correctly ase module, which is dependent to numpy). My test code is simple test.cpp #include "Python.h" #include #include extern "C" void Py_Initialize(); extern "C" void PyErr_Print(); using namespace std; int main(i

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread josef . pktd
On Wed, Feb 27, 2013 at 3:01 PM, David Pine wrote: > Pauli, Josef, Chuck, > > I read over the discussion on curve_fit. I believe I now understand what > people are trying to do when they write about scaling the weighting and/or > covariance matrix. And I agree that what polyfit does in its curre

Re: [Numpy-discussion] [EXTERNAL] swig interface file (numpy.i) warning

2013-02-27 Thread Bill Spotz
Is there documentation for the new C API for numpy? Thanks, Bill On Feb 26, 2013, at 2:04 PM, Bill Spotz wrote: > So the difference is that I was wanting to make changes in the git repository > that is at version 1.8. I would expect it to still work, though. > > I can take a look at the scipy

Re: [Numpy-discussion] Apply transform to many small matrices

2013-02-27 Thread Nathaniel Smith
On 27 Feb 2013 12:57, "Jorge Scandaliaris" wrote: > > Hi, > First of all excuse me if this is a trivial question. I have the feeling it is, > but searching and looking through the docs has proven unsuccesful so far. > > I have an ndarray A of shape (M,2,2) representing M 2 x 2 matrices. Now I want

[Numpy-discussion] [ANN] SciPy2013: Call for abstracts

2013-02-27 Thread Jonathan Rocher
[Apologies for cross-posts] Dear all, The annual SciPy Conference (Scientific Computing with Python) allows participants from academic, commercial, and governmental organizations to showcase their latest projects, learn from skilled users and devel

Re: [Numpy-discussion] Plans for missing data

2013-02-27 Thread Lluís
Charles R Harris writes: > On Wed, Feb 27, 2013 at 8:31 AM, Lluís wrote: > Hi there, > I haven't been able to find an answer after a quick search, but are there > any > plans regarding the (re)inclusion of missing data support into some future > version of numpy? >

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread David Pine
Pauli, Josef, Chuck, I read over the discussion on curve_fit. I believe I now understand what people are trying to do when they write about scaling the weighting and/or covariance matrix. And I agree that what polyfit does in its current form is estimate the absolute errors in the data from the

Re: [Numpy-discussion] Apply transform to many small matrices

2013-02-27 Thread Jorge Scandaliaris
Jaime Fernández del Río gmail.com> writes: > np.einsum makes a lot of these easier to figure out: > In [7]: np.einsum('ijk, kl', A, T) > Out[7]:  > array([[[ 7, 10], >         [15, 22]], > >        [[23, 34], >         [31, 46]], > >        [[39, 58], >         [47, 70]]]) > Thanks, I will h

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread Pauli Virtanen
27.02.2013 16:40, David Pine kirjoitti: [clip] > 2. I am sorry but I don't understand your response. The matrix Vbase > in the code is already the covariance matrix, _before_ it is scaled by > fac. Scaling it by fac and returning Vbase*fac as the covariance > matrix is wrong, at least according

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread josef . pktd
Please post inline so we have the context. On Wed, Feb 27, 2013 at 9:40 AM, David Pine wrote: > Chuck, > > Thanks for the quick reply. > > 1. I see your point about zero weights but the code in its current form > doesn't take into account zero weights in counting the degrees of freedom, > as you

Re: [Numpy-discussion] Plans for missing data

2013-02-27 Thread Charles R Harris
On Wed, Feb 27, 2013 at 8:31 AM, Lluís wrote: > Hi there, > > I haven't been able to find an answer after a quick search, but are there > any > plans regarding the (re)inclusion of missing data support into some future > version of numpy? > > Not at the moment, but it sits in the back of my mind.

[Numpy-discussion] Plans for missing data

2013-02-27 Thread Lluís
Hi there, I haven't been able to find an answer after a quick search, but are there any plans regarding the (re)inclusion of missing data support into some future version of numpy? Thanks a lot! Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the

Re: [Numpy-discussion] Apply transform to many small matrices

2013-02-27 Thread Jaime Fernández del Río
On Wed, Feb 27, 2013 at 5:41 AM, Jorge Scandaliaris wrote: > Jorge Scandaliaris yahoo.es> writes: > > I have an ndarray A of shape (M,2,2) representing M 2 x 2 matrices. > > Now I want to apply a transform T of shape (2,2) to each of matrix. > np.einsum makes a lot of these easier to figure out:

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread David Pine
Chuck, Thanks for the quick reply. 1. I see your point about zero weights but the code in its current form doesn't take into account zero weights in counting the degrees of freedom, as you point out, so it seems to me like a moot point. More importantly, the documentation doesn't explain what t

[Numpy-discussion] flatnonzero / nonzero returned indices order

2013-02-27 Thread Gabor Kovacs
Hello, for 1-D arrays, can one assume that the indices returned by flatnonzero is ordered? It looks so, but no such statement anywhere in the docs. (In general, order of indices in case of higher dimensions?) Thanks Gabor ___ NumPy-Discussion mailing li

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread Charles R Harris
On Wed, Feb 27, 2013 at 6:46 AM, David Pine wrote: > As of NumPy v1.7, numpy.polyfit includes an option for providing weighting > to data to be fit. It's a welcome addition, but the implementation seems a > bit non-standard, perhaps even wrong, and I wonder if someone can enlighten > me. > > 1.

[Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread David Pine
As of NumPy v1.7, numpy.polyfit includes an option for providing weighting to data to be fit. It's a welcome addition, but the implementation seems a bit non-standard, perhaps even wrong, and I wonder if someone can enlighten me. 1. The documentation does not specify what the weighting array "w"

Re: [Numpy-discussion] Apply transform to many small matrices

2013-02-27 Thread Jorge Scandaliaris
Jorge Scandaliaris yahoo.es> writes: <...> > I have an ndarray A of shape (M,2,2) representing M 2 x 2 matrices. > Now I want to apply a transform T of shape (2,2) to each of matrix. > The way I do this now is by iterating over all rows of A > multiplying the matrices using numpy.dot(): > > for

[Numpy-discussion] Apply transform to many small matrices

2013-02-27 Thread Jorge Scandaliaris
Hi, First of all excuse me if this is a trivial question. I have the feeling it is, but searching and looking through the docs has proven unsuccesful so far. I have an ndarray A of shape (M,2,2) representing M 2 x 2 matrices. Now I want to apply a transform T of shape (2,2) to each of matrix. The