Hello I have a data frame in python jupyter notebook and need to take the last column of it. How Can I take the last column of data frame?
Asked
Active
Viewed 134 times
1 Answers
1
Use iloc index, it should do the trick
df.iloc[:,-1]
It works on such way that :
selects all rows and -1
selects last column

Kamil Niski
- 4,580
- 1
- 11
- 24