[Tutor] Need Help on Assignment
Tom Strickland
tlinux at comcast.net
Tue Aug 23 22:22:20 CEST 2005
I have imported a text file consisting of lines of csv. Each line
consists of six items separated by commas. I have converted this file
into a matrix of string variables, T[i]. Now I want to extract each of
the individual strings, convert five them to floats, and save them in
individual vectors. That is, I'd like to convert each T[i] into date[i]
(a string), open[i] (a float) etc. Python doesn't like the ways I've
attempted to make these assignments.
T[i], which is a six-column matrix, works fine. However, if I say
date[i] = T[i][0], it doesn't like this. I've tried several variations
on this but with no success. Things like: [date[i],open[i], etc] = T[i]
didn't work either.
What do I need to do to make this type of assignment?
Thank you.
More information about the Tutor
mailing list