[Numpy-discussion] Apply a vector function to each row of a matrix

David Huard david.huard@gmail....
Thu Oct 9 08:24:45 CDT 2008


Look at: apply_along_axis


On Thu, Oct 9, 2008 at 8:04 AM, Neal Becker <ndbecker2@gmail.com> wrote:

> Suppose I have a function (I wrote in c++) that accepts a numpy 1-d vector.
>  What is the recommended way to apply it to each row of a matrix, returning
> a new matrix result?  (Assume the function has signature newvec = f
> (oldvec))
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081009/db91dc90/attachment.html 

More information about the Numpy-discussion mailing list