From: Robert K. <rob...@gm...> - 2006-10-24 01:26:50
|
Charles R Harris wrote: > > On 10/23/06, *Tim Hochberg* <tim...@ie... > <mailto:tim...@ie...>> wrote: > > Albert Strasheim wrote: > > Hello all > > > > I'm trying to generate random 32-bit integers. None of the > following seem to > > do the trick with NumPy 1.0.dev3383: > > > > In [32]: N.random.randint (-2**31, 2**31-1) > > ValueError: low >= high > > There should be a raw output from mtrand somewhere that gives random > uint32 output which you might be able to cast somehow. Really, there > should also be a signed output somewhere but I haven't looked closely at > the mtrand interface. There is RandomState.tomaxint(), which returns signed integers >= 0 and <= sys.maxint. It didn't get exposed at the module level, for some reason, though. -- 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 |