Last active
December 17, 2022 05:16
-
-
Save MartinWeiss12/5d6b0ffc01ed72639c4de6fb5ce51c45 to your computer and use it in GitHub Desktop.
DataFrame ETL
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
msPlayedList = (data['ms_played']).tolist() | |
est = pytz.timezone('US/Eastern') | |
utc = pytz.utc | |
fmt = '%Y-%m-%d %H:%M:%S' | |
for ind in data.index: | |
date = (data['ts'][ind]) | |
holdTS = datetime(int(date[0:4]), int(date[5:7]), | |
int(date[8:10]), int(date[11:13]), | |
int(date[14:16]), int(date[17:19]), tzinfo = utc) | |
estTS = holdTS.astimezone(est).strftime(fmt) | |
data.at[ind, 'ts'] = estTS | |
dateList = data['ts'].tolist() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment