numpy/numpy — pull request #4112 by rhewett (2013-12-07 23:26:18+00:00)
Title: Allow meshgrid to take 1D inputs

I work with many problems that are generic in their dimensionality (1D, 2D, 3D, etc). Patterns like the follwing example occur frequently, where, e.g., there is a number of nodes for each dimension, yet the code is agnostic to the number of dimensions.

nodes = [5, 6, 7]
indices = [np.arange(n) for n in nodes]
dims = np.meshgrid(*indices)

Currently, `numpy.meshgrid` does not allow cases like

nodes = [5]

and thus, I am required to handle a special case for 1D every time I want to use `meshgrid`.

This patch allows `meshgrid` to take a single argument, which allows such generic patterns to be useful.