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 86 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,350
- 1
- 10
- 23