With the help of scipy.integrate.simps() method, we can get the integration of y(x) using samples along the axis and composite simpson’s rule by using scipy.integrate.simps() method.
Syntax :
scipy.integrate.simps(y, x)
Return : Return the integrated value of y(x) using samples.
Example #1 :
In this example we can see that by using scipy.integrate.simps() method, we are able to get the integrated value of y(x) using samples and composite simpson’s rule by using this method.
# import numpy and scipy.integrate import numpy as np from scipy import integrate x = np.arange(0, 10) y = np.arange(0, 10) # using scipy.integrate.simps() method gfg = integrate.simps(y, x) print(gfg) |
Output :
40.5
Example #2 :
# import numpy and scipy.integrate import numpy as np from scipy import integrate x = np.arange(0, 10) y = np.sqrt(x) # using scipy.integrate.simps() method gfg = integrate.simps(y, x) print(gfg) |
Output :
17.875036119764566
Recommended Posts:
- Python | Scipy integrate.quadrature() method
- Python | Scipy integrate.tplquad() method
- Python | Scipy integrate.dblquad() method
- Python | Scipy integrate.quad() method
- Python | Scipy integrate.romb() method
- Python | Scipy integrate.fixed_quad() method
- Python | Scipy integrate.romberg() method
- Python | Scipy integrate.cumtrapz() method
- Python | Scipy stats.halfgennorm.logpdf() method
- Python | Scipy stats.halfgennorm.pdf() method
- Python | Scipy stats.halfgennorm.rvs() method
- Python | Scipy stats.halfgennorm.cdf() method
- Python | Scipy stats.halfgennorm.logcdf() method
- Python | Scipy stats.halfgennorm.sf() method
- Python | Scipy stats.halfgennorm.logsf() method
- Python | Scipy stats.halfgennorm.ppf() method
- Python | Scipy stats.halfgennorm.isf() method
- Python | Scipy stats.halfgennorm.moment() method
- Python | Scipy stats.halfgennorm.stats() method
- Python | Scipy stats.halfgennorm.entropy() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

