speed of numpy.power()?

Robert Kern robert.kern at gmail.com
Wed Aug 25 12:44:06 EDT 2010


On 8/25/10 8:59 AM, Carlos Grohmann wrote:
> Hi all,
>
> I'd like to hear from you on the benefits of using numpy.power(x,y)
> over (x*x*x*x..)
>
> I looks to me that numpy.power takes more time to run.

You will want to ask numpy questions on the numpy mailing list:

   http://www.scipy.org/Mailing_Lists

The advantage that numpy.power(x,y) has over (x*x*x...) is that y can be 
floating point. We do not attempt to do strength reduction in the integer case.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list