[SciPy-user] Create n-dim array from axis

Paul Hilscher p.hilscher@lsw.uni-heidelberg...
Mon Mar 23 02:54:29 CDT 2009

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 found
any versatile and clean one. Any hints ?

Thanks for all help,


More information about the SciPy-user mailing list