Skip to content

Instantly share code, notes, and snippets.

@itsderek23
Last active April 11, 2019 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsderek23/b77f83671e9a6edb6f2f8c0d6f007685 to your computer and use it in GitHub Desktop.
Save itsderek23/b77f83671e9a6edb6f2f8c0d6f007685 to your computer and use it in GitHub Desktop.
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