I've looking around for this but I can't seem to find it (though it must be extremely trivial).
The problem that I have is that I would like to retrieve the value of a column for the first and last entries of a data frame. But if I do:
df.ix[0]['date']
I get:
datetime.datetime(2011, 1, 10, 16, 0)
but if I do:
df[-1:]['date']
I get:
myIndex
13 2011-12-20 16:00:00
Name: mydate
with a different format. Ideally, I would like to be able to access the value of the last index of the data frame, but I can't find how.
I even tried to create a column (IndexCopy) with the values of the index and try:
df.ix[df.tail(1)['IndexCopy']]['mydate']
but this also yields a different format (since df.tail(1)['IndexCopy'] does not output a simple integer).
Any ideas?