[SciPy-user] Create n-dim array from axis
Mon Mar 23 08:38:47 CDT 2009
>>> mx, my = numpy.meshgrid(x, y)
>>> [zip(a,b) for (a,b) in zip(mx, my)]
On Mon, Mar 23, 2009 at 3:54 AM, Paul Hilscher <
> Dear all,
> I am looking for a function which takes some axes as an argument and
> produce the correspond n-dimensional array.
> So let's say we have two dimensions with following axis
> x = linspace(0.0,1.0,3)
> y = linspace(2.0,3.0,3)
> and we want to create the array by providing only the axis
> arr = create_array(x,y)
> and "create_array" produces then
> arr = array([[0.0,2.0], [0.5,2.0], [1.0,2.0]],
> [[0.0,2.5], [0.5,2.5], [1.0,2.5]]
> [[0.0,3.0], [0.5,3.0], [1.0,3.0]])
> I've been looking for quite a while now for such a function, but I did not
> any versatile and clean one. Any hints ?
> Thanks for all help,
> SciPy-user mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user