Suresh Jeevanandam wrote:
> Hi all,
>       Lets say I have an array:
>       from numarray import *
>       a = array([ 6,  7,  8,  9, 10, 11, 12])
> 
>       I want to multiply out all the elements and get the result.
>       
>       r = 1.0
>       for i in a:
>               r = r*i
> 
>       Is there any faster, efficient way of doing this.

r = multiply.reduce(a)

-- 
Robert Kern
[EMAIL PROTECTED]

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to