[SciPy-User] How to feed np.mgrid a variable number of 'arguments'
Mon Mar 5 12:27:45 CST 2012
I am guessing there is an easy way to do this, but I am just not seeing
it. I have a function where I can have a variable number of input
dimensions. In the function, I need to use np.mgrid to generate the data I
need. How would I create a line of code that would feed np.mgrid a
variable number of inputs? For example:
3d, with 17 nodes
a = np.mgrid[0:17,0:17,0:17]
a = np.mgrid[0:17,0:17,0:17,0:17]
Is there a way I can do
inDims = a_number
a = np.mgrid[0:17,0:17...a_number of times]
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User