Last active
August 29, 2015 14:01
-
-
Save michaelwills/37ed3c9d8db83dbf3c9c to your computer and use it in GitHub Desktop.
Get the timestamp of a sliced row in a pandas dataframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pandas import * | |
from numpy import * | |
from numpy.matlib import randn | |
dates = date_range('1/1/2000', periods=8) | |
df = DataFrame(randn(8, 4), index=dates, columns=['A', 'B', 'C', 'D']) | |
i = df.loc['20000101'] | |
In [157]:i.name | |
Out[157]: Timestamp('2000-01-01 00:00:00', tz=None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment