Let's say I want to integrate x**2 from 0 to 1. I do it using the scipy.integrate.quad:
from scipy import integrate
def f(x): return x**2
I = integrate.quad(f, 0, 1)[0]
print(I)
Questions: Is there any way to know how many times the user-defined function f gets called by the quad? I want to do it as I am interested to know how many have been utilized by quad to evaluate the integral.