Here I found an example of using integrate.cumtrapz(), but it doesn’t work for me – when I try to set initial=0 in
y_int = integrate.cumtrapz(y, x, initial=0)
I get an error
TypeError: cumtrapz() got an unexpected keyword argument 'initial'
What’s the problem?
What version of scipy are you running? I’ve scipy 0.10.1, and the keyword
initialis not recognized either. Moreover, the docstring does not have it either, while the source code for scipy 0.11 (which you linked) has it. Which leads me to a guess that it’s something which was added in v 0.11.Indeed:
then checking the source (which is in
quadrature.py) — the signature isTo check the scipy version, do this: