Is there a way to vectorize the creation of np.meshgrid?
#Example of normal np.meshgrid
x = [1.22749725, 2.40009184, 1.48602747, 2.83286752, 2.37426951]
y = [1.23816021, 1.69811451, 2.08692546, 2.13706377, 1.60298873]
gridrez=10
X,Y = np.meshgrid(np.linspace(min(x), max(x), endpoint=True, num=gridrez),
np.linspace(min(y), max(y), endpoint=True, num=gridrez))
# X.shape = 10x10
# Y.shape = 10x10
I would like to replicate this functionality but instead of x,y being 1x5 arrays they are 1000x5 arrays, and the resulting X,Y would be 1000x10x10. Note I have found a way to vectorize the np.linspace so don't worry about it. Assume we have two (1000x10) arrays and want to create a meshgrid of 1000x10x10. When I feed the answer in I get a (10000,10000) meshgrid instead of 1000x10x10