[Numpy-discussion] divmod issue

Robert Kern robert.kern at gmail.com
Sun Aug 6 03:18:23 CDT 2006


David Grant wrote:
> The following lines of code:
> 
> from numpy import floor
> div, mod = divmod(floor(1.5), 12)
> 
> generate an exception:
> 
> ValueError: need more than 0 values to unpack
> 
> in numpy-0.9.8. Does anyone else see this? It might be due to the fact 
> that floor returns a float64scalar. Should I be forced to cast that to 
> an int before calling divmod with it?

I don't see an exception with a more recent numpy (r2881, to be precise). Please 
try a later version.

-- 
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 Numpy-discussion mailing list