[Numpy-discussion] rand argument question (original) (raw)

Alan G Isaac aisaac at american.edu
Fri Jun 2 13:41:27 EDT 2006


On Fri, 02 Jun 2006, Sven Schreiber apparently wrote:

why doesn't rand accept a shape tuple as argument? I find the difference between the argument types of rand and (for example) zeros somewhat confusing. ... Can anybody offer an intuition/explanation?

Backward compatability, I believe. You are not alone in finding this odd and inconsistent. I am hoping for a change by 1.0, but I am not very hopeful.

Robert always points out that if you want the consistent interface, you can always import functions from the 'random' module. I have never been able to understand this as a response to the point you are making.

I take it the core argument goes something like this:

This is one place where I believe a forward looking (i.e., think about new users) vision would force a small change in these convenience functions that will have payoffs both in ease of use and in eliminating this recurrent question from discussion lists.

Cheers, Alan Isaac



More information about the NumPy-Discussion mailing list