pylab, integral of sinc function

Schüle Daniel uval at rz.uni-karlsruhe.de
Mon Feb 19 12:48:01 EST 2007


[...]

>> In [19]: def simple_integral(func,a,b,dx = 0.001):
>>     ....:     return sum(map(lambda x:dx*x, func(arange(a,b,dx))))
> 
> Do you mean
> 
>  def simple_integral(func,a,b,dx = 0.001):
>     return dx * sum(map(func, arange(a,b,dx)))
> 

yes, this should be faster :)



More information about the Python-list mailing list