[SciPy-dev] numpy.random.randint

Robert Kern robert.kern at gmail.com
Fri Mar 10 12:57:11 EST 2006


Johannes Löhnert wrote:
> Hi,
> 
> I just noticed that in function numpy.random.randint,
> the shape=... keyword was replaced by size=...
> 
> I find this somewhat counterintuitive, as it denotes
> the _shape_ of the desired array (as tuple),
> although it also takes integer values. Also it is an
> unnecessary break with backwards compatibility (to RandomArray).

It was a choice for compatibility with the scipy PRNGs all of which use "size".
"shape" was not a good argument name because many of the probability
distributions have a "shape" parameter.

> I would suggest to allow both "shape" & "size", with "shape"
> having precedence.

I don't think it's wise to make more ways to do exactly the same thing.

-- 
Robert Kern
robert.kern at gmail.com

"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 SciPy-Dev mailing list