Re: [Numpy-discussion] np.asfortranarray: unnecessary copying?

2010-07-31 Thread Kurt Smith
On Fri, Jul 30, 2010 at 1:33 PM, Anne Archibald aarch...@physics.mcgill.ca wrote: This seems to me to be a bug, or rather, two bugs. 1D arrays are automatically Fortran-ordered, so isfortran should return True for them (incidentally, the documentation should be edited to indicate that the data

[Numpy-discussion] np.asfortranarray: unnecessary copying?

2010-07-30 Thread Kurt Smith
What are the rules for when 'np.asarray' and 'np.asfortranarray' make a copy? This makes sense to me: In [3]: carr = np.arange(3) In [6]: carr2 = np.asarray(carr) In [8]: carr2[0] = 1 In [9]: carr Out[9]: array([1, 1, 2]) No copy is made. But doing the same with a fortran array makes a

Re: [Numpy-discussion] np.asfortranarray: unnecessary copying?

2010-07-30 Thread Anne Archibald
This seems to me to be a bug, or rather, two bugs. 1D arrays are automatically Fortran-ordered, so isfortran should return True for them (incidentally, the documentation should be edited to indicate that the data must also be contiguous in memory). Whether or not this change is made, there's no