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
  • 440
  • 1
  • 8
  • 19

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,580
  • 1
  • 11
  • 24