Generate a two dimensional array of complex numbers
<p>I want to generate a two dimensional array of a given size containing complex numbers like in this example:</p>

<pre><code>&gt;&gt;&gt; generate_array((2, 3))
array([[ 0.+0.j,  1.+0.j,  2.+0.j],
       [ 0.+1.j,  1.+1.j,  2.+1.j]])
</code></pre>

<pre><code>def generate_array(m, n):
    return (np.arange(m) * 1j)[:, None] + np.arange(n)


generate_array(2, 3)
Out: 
array([[ 0.+0.j,  1.+0.j,  2.+0.j],
       [ 0.+1.j,  1.+1.j,  2.+1.j]])
</code></pre>

python numpy