Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49383

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

From Robert Kern <robert.kern@gmail.com>
Subject Re: ? get negative from prod(x) when x is positive integers
Date 2013-06-28 17:19 +0100
References <CALyJZZUcfwJGbn_UqCmsUUcv9MaimyD+vjjW+d64wVc0G0f92A@mail.gmail.com> <CAN1F8qUNFSB4XW5iZ=hBszNnYvh8CCBunTWDFWKFzc1=-xCA9A@mail.gmail.com> <CALyJZZUa1Tt8wsKwFd=3-9MX9y0ZDiXHerfVyFQaG-YRHPOSJg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3965.1372436407.3114.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: ? get negative from prod(x) when x is positive integers Robert Kern <robert.kern@gmail.com> - 2013-06-28 17:19 +0100

csiph-web