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

Zachary Pincus zpincus at stanford.edu
Mon Mar 20 16:37:02 CST 2006


Hi folks,

I recently updated to the SVN head of numpy, and most of my data  
analysis code broke! Specifically, this code involved computing the  
SVD of flattened multidimensional data, and then reshaping the  
results back to the correct dimensionality. (A very common  
operation.) Now these reshape operations don't generate the right  
results.

It turns out that this is due to either (a) linalg.svd is returning  
fortran-style arrays when it used to return c-style arrays, or (b)  
numpy.reshape used to convert fortran-style arrays to c-style before  
reshaping, and now does not.

It seems to me that (a) is more likely. If so, is this a bug or a  
feature? I personally would argue that returning fortran-style arrays  
from any functions, unless specifically requested, is a serious bug,  
precisely because of problems like the above.

Any thoughts?

Zach Pincus

Program in Biomedical Informatics and Department of Biochemistry
Stanford University School of Medicine





More information about the Numpy-discussion mailing list