title: Convert map object to numpy array in python 3
body: <p>In Python 2 I could do the following:</p>
  
  <pre><code>import numpy as np    
  f = lambda x: x**2
  seq = map(f, xrange(5))
  seq = np.array(seq)
  print seq
  # prints: [ 0  1  4  9 16]
  </code></pre>
  
  <p>In Python 3 it does not work anymore:</p>
  
  <pre><code>import numpy as np    
  f = lambda x: x**2
  seq = map(f, range(5))
  seq = np.array(seq)
  print(seq)
  # prints: &lt;map object at 0x10341e310&gt;
  </code></pre>
  
  <p>How do I get the old behaviour (converting the <code>map</code> results to <code>numpy</code> array)?</p>
  
  <p><strong>Edit</strong>: As @jonrsharpe pointed out in his answer this could be fixed if I converted <code>seq</code> to a list first:</p>
  
  <pre><code>seq = np.array(list(seq))
  </code></pre>
  
  <p>but I would prefer to avoid the extra call to <code>list</code>.</p>