Deborah Swanson wrote:
> to do that is with .fget(). Believe me, I tried every possible way to
> use instance.A or instance[1] and no way could I get ls[instance.A].
Sorry, no.
To get a list of namedtuple instances use:
rows = csv.reader(infile)
Record = namedtuple("Record", next(rows))
records = [Record._make(row) for row in rows]
If you want a column from a list of records you need to extract it manually:
columnA = [record.A for record in records]
--
https://mail.python.org/mailman/listinfo/python-list