Last active
April 11, 2019 23:25
-
-
Save itsderek23/b77f83671e9a6edb6f2f8c0d6f007685 to your computer and use it in GitHub Desktop.
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 datetime | |
datetime_cols = [col for col in df_users.columns if col.endswith("_at")] | |
print("Timestamps cols to convert to datetime:",datetime_cols) | |
for col in datetime_cols: | |
df_users[col] = df_users.apply(lambda row: datetime.datetime.utcfromtimestamp(row[col]), axis=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment