[NumPy-Tickets] [NumPy] #1921: method index and coords of flatiter object are one-off
NumPy Trac
numpy-tickets@scipy....
Tue Aug 2 04:42:38 CDT 2011
#1921: method index and coords of flatiter object are one-off
--------------------+-------------------------------------------------------
Reporter: rvdb | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: Other | Version: 1.5.1
Keywords: |
--------------------+-------------------------------------------------------
Somewhere i read that the flatiter iterator object returned by a.flat
where a is some ndarray have methods index and coords. And indeed they
have but they seem to be 'one-off':
In [71]: a = ones((3,3))
In [72]: fla = a.flat
In [73]: for va in fla:
....: print fla.index, fla.coords, va
....:
1 (0, 1) 1.0
2 (0, 2) 1.0
3 (1, 0) 1.0
4 (1, 1) 1.0
5 (1, 2) 1.0
6 (2, 0) 1.0
7 (2, 1) 1.0
8 (2, 2) 1.0
9 (3, 0) 1.0
Otherwise it seems a quite fast way to iterate over all elements...
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1921>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list