[NumPy-Tickets] [NumPy] #1439: numpy.array(arr.flat) reorders arr's memory if arr.flags.fortran and arr.flags.owndata

NumPy Trac numpy-tickets@scipy....
Sat Mar 27 08:11:15 CDT 2010


#1439: numpy.array(arr.flat) reorders arr's memory if arr.flags.fortran and
arr.flags.owndata
-----------------------+----------------------------------------------------
 Reporter:  zachrahan  |       Owner:  somebody
     Type:  defect     |      Status:  new     
 Priority:  normal     |   Milestone:          
Component:  Other      |     Version:  devel   
 Keywords:             |  
-----------------------+----------------------------------------------------
 {{{
 import numpy
 a = numpy.array([[1,2],[3,4]], order='F')
 print a
 l = list(a.flat)
 print a
 f = numpy.fromiter(a.flat, a.dtype)
 print a
 a2 = numpy.array(a.flat)
 print a
 }}}

 yields:
 {{{
 array([[1, 2],
        [3, 4]])

 array([[1, 2],
        [3, 4]])

 array([[1, 2],
        [3, 4]])

 array([[1, 3],
        [2, 4]])
 }}}

 If 'a' is C-contiguous, this doesn't happen; likewise no problem (I think)
 if 'a' is a F-contiguous view on another array.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1439>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list