csv – python csv2libsvm.py: AttributeError: _csv.reader object has no attribute next

csv – python csv2libsvm.py: AttributeError: _csv.reader object has no attribute next

This is because of the differences between python 2 and python 3. Use the built-in function next in python 3. That is, write next(reader) instead of reader.next() in line 47. In addition, you should open the file in the text mode. So, change line 47 as i = open( input_file, r ).

For Python 3.x:

Use next(reader) instead of reader.next()

csv – python csv2libsvm.py: AttributeError: _csv.reader object has no attribute next

Leave a Reply

Your email address will not be published. Required fields are marked *