Very simply put,
For the same training data frame df
, when I use
X = df.iloc[:, :-1].values
, it will select till the second last column of the data frame instead of the last column (which is what I want BUT it's a strange behavior I've never seen before), and I know this as the second last column's value and the last column's value for that row is different.
However, using
y = df.iloc[:, -1].values
gives me the row vector of the last column's values which is exactly what I want.
Why is the negative 1 for X giving me the second last column's value instead?