[SciPy-user] Simpson bug?

David M. Cooke cookedm at physics.mcmaster.ca
Wed Jun 7 20:47:54 CDT 2006


On Wed, Jun 07, 2006 at 01:36:31PM +0200, Peter Bienstman wrote:
> Hi,
> 
> There seems to be an inconsistency in the Simpson quadrature routines (in 
> 0.4.8). Depending on whether the number of points is odd or even, you get a 
> scalar or an array as result:
> 
> import scipy.integrate
> 
> >>print scipy.integrate.simps([1,2,3])
> 
> 4.0
> 
> >>print scipy.integrate.simps([1,2,3,4])
> 
> [ 7.5]

I've fixed this in svn.

The simple routines like simps in scipy.integrate were indexing arrays
using a list of slices, instead of a tuple.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca



More information about the SciPy-user mailing list