title: how to vectorize an operation on a 1 dimensionsal array to produce 2 dimensional matrix in numpy
body: <p>I have a 1d array of values </p>
  
  <pre><code>i = np.arange(0,7,1)
  </code></pre>
  
  <p>and a function</p>
  
  <pre><code># Returns a column matrix
  def fn(i):
      return np.matrix([[i*2,i*3]]).T
  
  
  fnv = np.vectorize(fn) 
  </code></pre>
  
  <p>then writing</p>
  
  <pre><code>fnv(i)
  </code></pre>
  
  <p>gives me an error</p>
  
  <pre><code>  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "c:\Python33\lib\site-packages\numpy\lib\function_base.py", 
          line 1872, in __call__
      return self._vectorize_call(func=func, args=vargs)
    File "c:\Python33\lib\site-packages\numpy\lib\function_base.py", 
          line 1942, in _vectorize_call
          copy=False, subok=True, dtype=otypes[0])
    ValueError: setting an array element with a sequence.
  </code></pre>
  
  <p>The result I am looking for is a matrix with two rows and as many columns as in the input array. What is the best notation in numpy to achieve this?</p>
  
  <p>For example <em>i</em> would equal </p>
  
  <pre><code>[1,2,3,4,5,6]
  </code></pre>
  
  <p>and the output would equal</p>
  
  <pre><code>[[2,4,6,8,10,12],
   [3,6,9,12,15,18]]
  </code></pre>