[NumPy-Tickets] [NumPy] #2067: when x is an N-D array, list(x) produces surprising results

NumPy Trac numpy-tickets@scipy....
Mon Feb 27 13:45:11 CST 2012


#2067: when x is an N-D array, list(x) produces surprising results
------------------------+---------------------------------------------------
 Reporter:  pfeldman    |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  numpy.core  |     Version:  1.6.1      
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by pv):

 The behavior does make sense, and it is what would naturally be expected.
 From the point of view of iteration, a N-dim ndarray *is* a collection of
 (N-1)-dim sub-arrays. The list constructor merely retains the consistency
 between `list(a)[j]` and `list(a[j])`. I don't see any reason to change
 this behavior, as raveling is a separate operation.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2067#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list