any computer expert here please help me with this what is the purpose of the following statement 1.df[:] 2.df.iloc[:-4,:]
please don't spoil if you don't know the ans
otherwise I will report all your answers
it is correct question only computer students can understand it.
Answers
Answered by
4
Answer:
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?
Explanation:
hope it will be helpful to you dear friend
Similar questions
Science,
6 hours ago
Environmental Sciences,
6 hours ago
Math,
11 hours ago
Chemistry,
7 months ago
Math,
7 months ago