Given a set of data (x,y,z) with z>0 (around 10^4 points), I want to find the volume under the surface it describes using python. All these data points are randomly generated and unsorted, but from the 3D plot the surface is smooth and vanishing. See here plotted data
So far, I have checked the following related topics
Using Convex Hull : _Among other errors this one: QhullError: QH6114 qhull precision error: initial simplex is not convex.
Trapezoidal: Although it runs, I don't trust in the result, since even generating half sphere shell the volume was wrong.
Other Convex Hull: Same errors as before.
I also though I could make a grid and interpolate and then compute the double integral
# Given independents numpy.ndarray x2, y2, and z2
# Set up a regular grid of interpolation points
x1i = np.linspace(x2.min(), x2.max(), 1000)
y1i = np.linspace(y2.min(), y2.max(), 1000)
x1i, y1i = np.meshgrid(x1i, y1i)
# Interpolate;
z1i = scipy.interpolate.griddata((x2, y2), z2, (x1i, y1i), method='linear')
But then I don't know how to implement dblquad given the griddata
integrate.dblquad(z1i, min(x2),max(x2),lambda x: min(y2), lambda x: max(y2), epsabs=1.49e-08, epsrel=1.49e-08)
doesn't work.
How can I do it?