y = np.array([5, 20, 4, 18, 19, 18, 7, 4])
area = trapz(y, dx=5)
print(('area =', area))
area = simps(y, dx=5)
print(('area =', area))
Calculating the area under a curve given a set of coordinates, without knowing the function