dropping a row in pandas with dates indexes, python -


I'm trying to leave the last row in a dataframe created by Panda in Python And seems to be having trouble.

  index = date range ('1/1/2000', duration = 8) df = dataframe (randon (8, 3), index = index, column = ['A', 'B', 'C'])   

I tried this kind of drop method:

  df.drop ( [Size (DF) [0] -1], axis = 0)   

but it does not keep the label contained in the axis Is.

I also tried to drop by the index name and it still does not work.

Any advice would be appreciated. Thanks!

  df.ix [: - 1]   

Removes the original dataframe with the last line.

Comments