I know how to perform a double integral in python
import numpy as np
import scipy.integrate as integrate
integrate.dblquad(x*y, 0, 1, lambda x: -np.sqrt(1-x**2), lambda x: np.sqrt(1-x**2))
where x and y are, say, (200,) numpy arrays.
However, what if the integrand (x*y) above is a 2D array rather than a function? In my case, I have an array Z which has a value at every coordinate (x,y), i.e. it has shape (200,200). However, I do not know in advance the continuous function(s) that it would correspond to.
How would I perform this integral? Thanks.