I have an array of object with size (22, 2) for Y axis, and the corresponding x-axis is an array of object with size (22, 2) as well. I need to calculate the Area between the curve y = f(x), and the x-axis, for each array. I wrote this code:
Area = np.trapz(y,x)
I got an array of object in which each module consists of many elements, but I expected to get a single value (area) for each y=f(x).
How can I calculate correctly the area for each function f(x) stored in the array of object?