Last active
June 22, 2018 12:07
-
-
Save RenSys/4e09e5066aa829d029b556c4ca59b575 to your computer and use it in GitHub Desktop.
Pandas - Datetime Index
This file contains hidden or 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
d.DataFrame(data={'value_1': value_series_1, | |
'value_2': value_series_2, | |
'timestamp': date_time_list}, | |
index=[0, 1, 2, 3, 4]) | |
df.set_index(pd.to_datetime(df.timestamp), inplace=True) | |
del df['timestamp'] | |
# index column now has time functions e.g. | |
df.index.year |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment