python 3 csv file - attribute error
Question: 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'
    


Answer: The CSV reader already separates all the fields for you. That is, your `line`
variable is already a list, not a string, so there's nothing to strip and
nothing to split. Use `line` the way you intended to use `unpacked`.

That's why you're using the `csv` package in the first place, remember.

