import time t1=time.time() import numpy as np from scipy import fft from scipy import fftpack t2=time.time() print "NumPy&SciPy import : %f s" % (t2-t1) d = np.linspace(0, 1e3, 1e6) t3=time.time() print "NumPy linspace 10**6 : %f s" % (t3-t2) fft(d) t4=time.time(); print "SciPy FFT 10**6 : %f s" % (t4-t3) fftpack.fft(d) t5=time.time(); print "SciPy FFTPack 10**6 : %f s" % (t5-t4)
import time t1=time.time() from scipy.integrate import tplquad t2=time.time() print "SciPy tplquad import : %f s" % (t2-t1) result = tplquad(lambda x, y, z: (x*y*z)**(x+y+z), 0, 1, lambda y: 0, lambda y: 1, lambda y, z: 0, lambda y, z: 1) t3=time.time(); print "SciPy tplquad (x*y*z)**(x+y+z) : %f s" % (t3-t2) print result