[NumPy-Tickets] [NumPy] #2067: when x is an N-D array, list(x) produces surprising results
NumPy Trac
numpy-tickets@scipy....
Sun Feb 26 15:55:43 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: |
------------------------+---------------------------------------------------
x= array([[1,2],[3,4]])
list(x)
[array([1, 2]), array([3, 4])]
list(x.ravel())
[1, 2, 3, 4]
The behavior of list(x) is not what any reasonable person would want, and
does not make sense conceptually either. (A Numpy 2-D array is not a
nesting of 1-D arrays). list(x.ravel()) works but is cumbersome.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/2067>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list