Access last index value of dataframe
The following gives you the last index value:
df.index[-1]
Example:
In [37]:
df.index[-1]
Out[37]:
Timestamp('2015-03-25 00:00:00')
Or you could access the index attribute of the tail
:
In [40]:
df.tail(1).index[0]
Out[40]:
Timestamp('2015-03-25 00:00:00')
Old post, but df.last_valid_index()
also works.