Question about nested loop
gvanem at broadpark.no
Mon Dec 31 12:25:16 CET 2012
"Isaac Won" <winefrog at gmail.com> wrote:
> while c < 10:
> c = c + 1
> for columns in ( raw.strip().split() for raw in f ):
> y = np.array(b, float)
> print c, y
> I thought that can get the arrays of the columns to ,
> but I only could get repetition of same arrays of columns.
I don't pretend to know list comprehension very well, but
'c' isn't incremented in the inner loop ( .. for raw in f).
Hence you only append to columns.
Maybe you could use another 'd' indexer inside the inner-loop?
But there must a more elegant way to solve your issue. (I'm a
More information about the Python-list