How can I split a dataset from a CSV file for training and testing?
I am using Python and I need to split my imported .csv data into two parts: training and test set, 70% EG training and 30% test.
I keep getting various errors like 'list' object is not callable
and so on.
Is there an easy way to do this?
thank
EDIT:
The code is basic, I just want to split the dataset.
from csv import reader
with open('C:/Dataset.csv', 'r') as f:
data = list(reader(f)) #Imports the CSV
data[0:1] ( data )
TypeError: 'list' object is not callable
+4
source to share