woooee has posted code what to do with rows in order to get needed data (slicing and appending).
PS - if you overstated your knowledge ("I have learned to use the .csv reader and I will stick to it for now") then you should refresh your memory by reading documentation csv.reader
Depending on your needs (do you want skip first row or not) you can iterate over reader object directly as (per documentation): "Return a reader object which will iterate over lines in the given csvfile. csvfile can be any object which supports the iterator protocol and returns a string each time its __next__() method is called — file objects and list objects are both suitable."
You can iterate over reader object directly:
PS - if you overstated your knowledge ("I have learned to use the .csv reader and I will stick to it for now") then you should refresh your memory by reading documentation csv.reader
Depending on your needs (do you want skip first row or not) you can iterate over reader object directly as (per documentation): "Return a reader object which will iterate over lines in the given csvfile. csvfile can be any object which supports the iterator protocol and returns a string each time its __next__() method is called — file objects and list objects are both suitable."
You can iterate over reader object directly:
>>> x_training = list() >>> y_training = list() >>> with open(csv_file, "r") as data: ... for row in csv.reader(data, delimiter=','): ... x_training.append(row[:-1]) ... y_training.append(row[-1]) ...I also suggest reading DeaD_EyE post carefully. Without fundamentals it's hard to write code which delivers results you want.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.