tengo un problema con respecto a un ejercicio que tengo que hacer, que trata de sumar los números de la columna final de los siguientes datos extraídos de un archivo de texto. y el otro de obtener el genero de película que mas se repite.
mando parte del archivo de txt (es largo)
Series_Title,Released_Year,Certificate,Runtime,Genre,IMDB_Rating,Overview,Meta_score,Director,Star1,Star2,Star3,Star4,No_of_Votes,Gross
The Shawshank Redemption,1994,A,142 min,Drama,9.3,""Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency."",80,Frank Darabont,Tim Robbins,Morgan Freeman,Bob Gunton,William Sadler,2343110,28341469"
The Godfather,1972,A,175 min,Crime,9.2,An organized crime dynasty's aging patriarch transfers control of his clandestine empire to his reluctant son.,100,Francis Ford Coppola,Marlon Brando,Al Pacino,James Caan,Diane Keaton,1620367,134966411
The Dark Knight,2008,UA,152 min,Action,9,""When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of the greatest psychological and physical tests of his ability to fight injustice."",84,Christopher Nolan,Christian Bale,Heath Ledger,Aaron Eckhart,Michael Caine,2303232,534858444"
The Godfather: Part II,1974,A,202 min,Crime,9,""The early life and career of Vito Corleone in 1920s New York City is portrayed, while his son, Michael, expands and tightens his grip on the family crime syndicate."",90,Francis Ford Coppola,Al Pacino,Robert De Niro,Robert Duvall,Diane Keaton,1129952,57300000"
12 Angry Men,1957,U,96 min,Crime,9,A jury holdout attempts to prevent a miscarriage of justice by forcing his colleagues to reconsider the evidence.,96,Sidney Lumet,Henry Fonda,Lee J. Cobb,Martin Balsam,John Fiedler,689845,4360000
entonces con estos datos tengo lo siguiente: En el caso de la suma.
total = 0
archivo = open('./top.txt','rt',encoding='utf-8')
archivo.readline()#leo la primera linea
for linea in archivo:
linea = linea.replace('"',"")
linea = linea.strip('\t\n')
linea = linea.split(';')
#print(linea)
total+= int(linea[15])
print(total)
archivo.close()
print linea = ['The Shawshank Redemption,1994,A,142 min,Drama,9.3,Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.,80,Frank Darabont,Tim Robbins,Morgan Freeman,Bob Gunton,William Sadler,2343110,28341469']
(AL reemplazar los ", se ponen '', no se a que se debe)
resulta que cuando corro el programa muestra:
total+= int(linea[15])
IndexError: list index out of range