? get negative from prod(x) when x is positive integers

Robert Kern robert.kern at gmail.com
Fri Jun 28 12:19:15 EDT 2013


On 2013-06-28 16:26, Vincent Davis wrote:
> @Joshua
> "You are using numpy.prod()"
> Wow, since sum([1,2,3,4]) worked I tried prod([1,2,3,4]) and got the right
> answer so I just used that. Confusing that it would use numpy.prod(), I realize
> now there is no python prod(). At no point do I "import numpy" in my code. The
> seems to be a result of using ipython, or at least how I am using it "ipython
> notebook --pylab inline".

The --pylab option will do the following import:

   from matplotlib.pyplot import *

That includes a "from numpy import *" in there.

-- 
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