I have a csv file in which the first column is the name of a baseball player, and then each subsequent item in the file is a statistic. I'd like to be able to import the file so that the player name was equal to a tuple of the statistics.
Right now when I import the file using this code:
Orioles = file("Orioles.csv", "rU")
for row in Orioles:
print row
I get something like this:
[Nick_Markakis, '.005', '.189', '.070', '.002', '.090']
[Adam_Jones, '.005', '.189', '.070', '.002', '.090']
I'd like to have the statistics be listed as floats rather than strings and be able to pull out the player name, and use it later, like this:
Nick_Markakis = ['.005', '.189', '.070', '.002', '.090']
Adam_Jones = ['.005', '.189', '.070', '.002', '.090']