0

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?

levan
  • 360
  • 1
  • 7
  • 18

1 Answers1

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