Last active
June 23, 2018 21:23
-
-
Save joonro/e9a116056612403302dc9e183a1b16e4 to your computer and use it in GitHub Desktop.
[Covert Date in Int to pd.Timestamp] #python #pandas #date #time
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
import pandas as pd | |
# convert to datetime | |
showdates = pd.to_datetime(con_df['showdate'].astype(str)) | |
# if you don't do `to_timedelta`, you will get integer numbers | |
# so convert it back to timedelta | |
pd.to_timedelta(showdates.values[1:] - showdates.values[:-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment