title: How to create multidimensional array with numpy.mgrid
body: <p>I wonder how to create a grid (multidimensional array) with numpy mgrid for an unknown number of dimensions (D), each dimension with a lower and upper bound and number of bins:</p>
  
  <pre><code>n_bins =  numpy.array([100 for  d in numpy.arrange(D)])
  bounds = numpy.array([(0.,1) for d in numpy.arrange(D)])
  grid = numpy.mgrid[numpy.linspace[(numpy.linspace(bounds(d)[0], bounds(d)[1], n_bins[d] for d in numpy.arrange(D)]
  </code></pre>
  
  <p>I guess above doesn't work, since mgrid creates array of indices not values. But how to use it to create array of values.</p>
  
  <p>Thanks</p>
  
  <p>Aso.agile </p>