I'm trying to create a list of named tuples from a CSV file. The error pulls up on line 12(the one starting with movie_list). It says that there are not enough values to unpack. I've done multiple other projects using this exact method, and no errors ever. Please, do not suggest alternate methods, as this is for a school project and has to be done this way.
Movie = namedtuple("Movie", "index, title, release, user_rating, metascore, imdb_votes, plot, genre, runtime, revenue, actors, director")
def read_data (file, encoding='utf-8'):
with open(file):
reader = csv.reader(file)
next(reader)
movie_list =[Movie(int(index), title, int(release), float(user_rating), float(metascore), int(imdb_votes), plot, genre, int(runtime), float(revenue), actors, director)
for index, title, release, user_rating, metascore, imdb_votes, plot, genre, runtime, revenue, actors, director in reader]
return movie_list