 <p>numpy <strong>vectorized</strong> approach will be <strong>much</strong> faster compared to regular for/list comprehension/etc. especially on big lists:</p> <pre><code>import numpy as np listA = np.array([51, 988, 1336, 2067, 1857, 3160]) listB = np.array([1, 2, 3, 4, 5, 6]) result = listA / np.pi * ((listB*0.1)+1)**2 - np.pi * (listB*0.1)**2 </code></pre> <p>Output:</p> <pre><code>In [175]: result Out[175]: array([ 19.61148715, 452.74017757, 718.41005008, 1289.07255327, 1329.19288378, 2573.86868192]) </code></pre> <p><strong>Timing and comparison on two 1M lists:</strong></p> <pre><code>In [183]: A = np.random.randint(1,100, 10**6) In [184]: B = np.random.randint(1,100, 10**6) In [185]: formula = lambda n,x: n / pi * ((x*0.1)+1)**2 - pi * (x*0.1)**2 </code></pre> <p>Vectorized numpy approach:</p> <pre><code>In [186]: %timeit formula(A, B) 10 loops, best of 3: 65.4 ms per loop </code></pre> <p>List comprehension:</p> <pre><code>In [191]: %timeit [ formula(a,b) for a,b in zip(A.tolist(),B.tolist()) ] 1 loop, best of 3: 3.6 s per loop </code></pre> <p><strong>Conclusion:</strong> vectorized approach is 55 times faster</p>