[SciPy-user] Inconsistent function calls?
Thu May 21 09:34:03 CDT 2009
This is because ones(3,3) will be called with 3 as the first argument
and 3 as the second argument, not with (3, 3) as the first argument.
As the second argument is also used for something else, it is not even
possible to detect if the second argument is an typo or a value for
the matrix (for objects, it's not possible to choose).
Python (a langage) is not meant to behave like Matlab (not a langage).
This was also raised several months/years ago, you can browse the ML
archives to find the discussion.
2009/5/21 Ivo Maljevic <firstname.lastname@example.org>:
> Just as I was making up an example for the block diagonal matrix question, I
> remembered the old problem I had with
> consistency of nympy functions.
> If you want to generate a random number matrix, you can make the same call
> as with matlab:
> rand(2,2) for 2x2 matrix,
> randn(1,5) for 1x5 etc.
> but if you want to generate ones or zeros matrices, you cannot say
> ones(3,3), you have to write ones([3,3]) or zeros([3,3]) (note the extra
> It is not a big deal, but it seems a bit inconsistent for me.
> SciPy-user mailing list
Information System Engineer, Ph.D.
Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92
More information about the SciPy-user