
December 30th, 2012, 01:25 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 2
Time spent in forums: 24 m 14 sec
Reputation Power: 0
|
|
|
Beginner at python, need help
I have a program that reads a CSV file. It currently looks like this. The CSV file is NFL Football stats. The names of the rows of the CSV are Name, Games, Receptions, Receiving Yards, etc.
import csv
players = {}
with open('NFL 2011 reassembled.csv', 'rU') as csvfile:
spamreader = csv.DictReader(csvfile, delimiter=',', quotechar='|')
for row in spamreader:
players[row['Name'].strip()] = row
The numbers are strings now, so I cannot change them. How can I change them into integers?
Thanks. I am a beginner to Python, so any help would be greatly appreciated.
|