title: reduce large dataset in python using reduce function
body: <p>I was trying a simple reduce function on a dataset of 1000000 integers,
  Here is what I'm trying to do,</p>
  
  <pre><code>from functools import reduce
  a = (x for x in range(1,1000000))
  reduce(lambda x,y: x*y,a)
  </code></pre>
  
  <p>Problem is, it is taking a lot of time! is there a faster way to implement this size of dataset? </p>