Skip to content

Instantly share code, notes, and snippets.

@MartinWeiss12
Last active December 17, 2022 05:16
Show Gist options
  • Save MartinWeiss12/5d6b0ffc01ed72639c4de6fb5ce51c45 to your computer and use it in GitHub Desktop.
Save MartinWeiss12/5d6b0ffc01ed72639c4de6fb5ce51c45 to your computer and use it in GitHub Desktop.
DataFrame ETL
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