On Sat, Jul 12, 2008 at 10:30 PM, Nadav Horesh <[EMAIL PROTECTED]> wrote:
> I am aware that the error is related to the broadcasting, and that it can > be solved by matching the shape of x to that of y --- this is how I solved > it in the first place. I was thinking that the function "promises" to > integrate over an array given a x vector and the axis, so let obscure the > broadcasting rules and just enable it to do the work. There is a reason to > leave trapz as it is (or even drop it) since numpy should stay as close as > possible to "bare metal", but this function is borrowed also by scipy > integration package, thus I rather give it a face lift. > I think you can pretty much borrow the average function to do this, all you need to do is generate the proper weights and scaling. It's in numpy/lib/function_base.py Chuck
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion