For datasets, It might be better to import read_csv
from pandas
rather than use the csv library. Try
from pandas import read_csv
dataset = read_csv(csvfile)
This will create a pandas Dataframe. If you need to manipulate it, the pandas library functions should be adequate. If not, you can import numpy
and use dataset = numpy.array(dataset)
.
If that doesn't work, try importing NumPy and using genfromtxt
instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…