(Apr-13-2019, 05:38 PM)stluwa Wrote:import pandas import numpy dataframe = pandas.read_csv("C:\Users\stluwa\cars.csv") array = dataframe.values X = array[:,0:8] Y = array[:,8]My problem is, I can not seem to figure out what is happening in the lines:
X = array[:,0:8] Y = array[:,8]My biggest question is what the [:,0:8] means. I'm doing some feature selection stuff, but i never learned python.
Hey, I'm not sure why it's [:,0:8] or [:,8] but it should instead be [:0:8] and [:8] respectively.
These are slices. You can read more about them here.
https://docs.python.org/3/tutorial/intro...ml#strings
https://docs.python.org/3/tutorial/intro...html#lists