vendredi 31 juillet 2015

numpy - meshgrid for multiple dimensions

numpy has a beautiful function which generate multidimensional grid. It is easy to work with it when number of dimension is low and is known in advance, but what to do when number of dimension is only known at time of execution or simply big and it takes too long to type. I guess I am looking for something like

 import numpy as np

 x = np.meshgrid(y)

where y is an array of arrays of evaluation points, for example

y = [array([-3.,  0.,  3.]) array([-3.,  0.,  3.]) array([-3.,  0.,  3.])]

Suggestions?

Aucun commentaire:

Enregistrer un commentaire