numpy.meshgrid explanation
<p>Could someone care to explain the <code>meshgrid</code> method? I cannot wrap my mind around it. The example is from the [SciPy][1] site:</p>
<pre><code>import numpy as np

nx, ny = (3, 2)
x = np.linspace(0, 1, nx)
print (&quot;x =&quot;, x)

y = np.linspace(0, 1, ny)
print (&quot;y =&quot;, y)

xv, yv = np.meshgrid(x, y)
print (&quot;xv_1 =&quot;, xv)
print (&quot;yv_1 =&quot;, yv)


xv, yv = np.meshgrid(x, y, sparse=True)  # make sparse output arrays
print (&quot;xv_2 =&quot;, xv)

print (&quot;yv_2 =&quot;, yv)
</code></pre>
<p>Printout is :</p>
<pre><code>x = [ 0.   0.5  1. ]
y = [ 0.  1.]
xv_1 = [[ 0.   0.5  1. ]
 [ 0.   0.5  1. ]]
yv_1 = [[ 0.  0.  0.]
 [ 1.  1.  1.]]
xv_2 = [[ 0.   0.5  1. ]]
yv_2 = [[ 0.]
 [ 1.]]
</code></pre>
<p>Why are arrays xv_1 and yv_1 formed like this ? Ty :)
[1]: <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html#numpy.meshgrid" rel="nofollow noreferrer">http://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html#numpy.meshgrid</a></p>