[Numpy-discussion] Re: linalg.svd returns fortran arrays, causes problems

Travis Oliphant oliphant.travis at ieee.org
Mon Mar 20 21:25:03 EST 2006


Zachary Pincus wrote:
>> Can you give us some small, self-contained code that demonstrates the 
>> problem?
>
> numpy.reshape(numpy.array([[1,2,3,4,5,6,7,8,9,10],[11,12,13,14,15,16,17,18,19,20]], 
> fortran = False), [2, 5, 2])
> array([[[ 1,  2],
>         [ 3,  4],
>         [ 5,  6],
>         [ 7,  8],
>         [ 9, 10]],
>
>        [[11, 12],
>         [13, 14],
>         [15, 16],
>         [17, 18],
>         [19, 20]]])
>
> numpy.reshape(numpy.array([[1,2,3,4,5,6,7,8,9,10],[11,12,13,14,15,16,17,18,19,20]], 
> fortran = True), [2, 5, 2])
> array([[[ 1,  6],
>         [ 2,  7],
>         [ 3,  8],
>         [ 4,  9],
>         [ 5, 10]],
>
>        [[11, 16],
>         [12, 17],
>         [13, 18],
>         [14, 19],
>         [15, 20]]])
>
>

This should be fixed now in SVN.   Thanks for pointing it out.

-Travis






More information about the NumPy-Discussion mailing list