atompy.integral_polyfit#
- atompy.integral_polyfit(x, y, lower=-inf, upper=inf, fit_degree=5, showfit=False)[source]#
Get the integral of the data. The integral is determined with by integrating a polynomial fit.
- Parameters:
- Returns:
- integral
float The value of the integral
- integral
Examples
- ::
>>> import numpy as np >>> import atompy as ap >>> x, y = np.linspace(0, 2, 5), np.linspace(0, 4, 5)**2 >>> x, y ([0. 0.5 1. 1.5 2. ], [ 0. 1. 4. 9. 16.]) >>> ap.integral_polyfit(x, y, fit_degree=2) 10.66