title: maps to numpy array, why is taking more time all together?
body: <p>I'm trying to optimize a loop on python. I'm trying to do it using map function, as you can see in the following code:</p>
  
  <pre><code>a=np.arange(5000)
  z=map(lambda x: a[x]-1,range(5000))
  j=np.array(list(z))
  </code></pre>
  
  <p>when I take the time of the code using %%timeit on the beginning of the code, It show me this number:</p>
  
  <pre><code>4.91 ms ± 71.3 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
  </code></pre>
  
  <p>Now, when I take the time of each line, I obtain the following output:</p>
  
  <pre><code>6.66 µs ± 126 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
  816 ns ± 5.11 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
  1.34 ms ± 9.38 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
  </code></pre>
  
  <p>Why the total time is different?</p>