I am trying to read in the following csv file:
https://github.com/eljefe6a/nfldata/blob/master/stadiums.csv
I copied and pasted the contents it into excel and save it as a csv file because it is in a unix format.
and I get the following attribute error message
Any help appreciated. Thank you.
import sys
import csv
with open('stadium.csv', newline='') as csvfile:
readCSV = csv.reader(csvfile,delimiter=',')
for line in readCSV:
line = line.strip()
unpacked = line.split(",")
stadium, capacity, expanded, location, surface, turf, team, opened, weather, roof, elevation = line.split(",")
results = [turf, "1"]
print("\t".join(results))
Error:
Traceback (most recent call last):
File "C:/Python34/mapper.py", line 31, in <module>
line = line.strip()
AttributeError: 'list' object has no attribute 'strip'
line.split(",")