import csv
def carregar_acessos():
X = []
Y = []
arquivo = open('acesso_pagina.csv', 'rb')
leitor = csv.reader(arquivo)
leitor.next()
for home,como_funciona,contato,comprou in leitor:
dado = [int(home),int(como_funciona),int(contato)]
X.append(dado)
Y.append([int(comprou)])
But when the executor informs that the "reader" does not have NEXT attribute. Could someone help me?
Terminal Return:
Traceback (most recent call last):
File "classifica_acesso.py", line 3, in <module>
X,Y = carregar_acessos()
File "/Users/josecarlosferreira/Desktop/machine-learning/dados.py", line 11, in carregar_acessos
leitor.next()
AttributeError: '_csv.reader' object has no attribute 'next'
According to what is shown in the lesson the code is correct and should work. But I tried to look for the change in Next, and I tested other codes that I found and well kept giving error.
Note: The first line of the CSV file is a Text and all others are integers.