On 12/15/06, Paulo Jose da Silva e Silva <[EMAIL PROTECTED]> wrote: > I did not try to imply that there are some functions in numpy that > return array when receiving matrices. What I meant is that there are > functions in numpy that always return arrays. Hence they ask for an > explicit conversion to matrices. Good examples is the whole numpy.random > sub-module. So if you want a random matrix you need to type:
There are many numpy functions that will take a matrix as input but return an array. The nan functions (nanmin, nanmax, nanargmin, nanargmax, nansum) are an example. The first line in these functions is y = array(a) which converts the matrix input into an array. A more matrix friendly alternative would be y = asanyarray(a) But are there any unintended consequences of changing from array to asanyarray? _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
