[Numpy-discussion] Flattening an array

2009-12-08 Thread Jake VanderPlas
Hello, I have a function -- call it f() -- which takes a length-N 1D numpy array as an argument, and returns a length-N 1D array. I want to pass it the data in an N-D array, and obtain the N-D array of the result. I've thought about wrapping it as such: #python code: from my_module import f # ta

Re: [Numpy-discussion] NumPy-Discussion Digest, Vol 38, Issue 52

2009-11-12 Thread Jake VanderPlas
> I'm rapidly losing interest here. Perhaps you could supply some code > implementing this new array? Why not just a class using an array that > doubles the array size when an index is out of bounds and copies over the > old data. That is pretty much what realloc does. As to python lists, do you >

Re: [Numpy-discussion] Accessing LAPACK and BLAS from the numpy C API

2009-11-09 Thread Jake VanderPlas
>The safe way to access them, since they are not exposed, is to call the >function at the python level in your C code, but I don't think that's >what you want, I want to avoid calling functions at the python level, because of the overhead for multiple calls within nested loops. I may have a solut

[Numpy-discussion] Accessing LAPACK and BLAS from the numpy C API

2009-11-07 Thread Jake VanderPlas
Hello, I'm working on wrapping a set of C++ routines for manifold learning (LLE, Isomap, LTSA, etc) in python. In the LLE routine, it is necessary to loop through the input points and perform an svd of each local covariance matrix. Presently I have my own C-LAPACK wrapper that I call within a C l