Created
October 20, 2018 22:15
-
-
Save DSamuylov/bcb39cadfb420211d8de30299a3ebdbd to your computer and use it in GitHub Desktop.
Convert timestamps between different data formats
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 numpy as np | |
import datetime | |
def convert_np_to_datetime(ts: np.datetime64) -> datetime.datetime: | |
return ts.astype("M8[us]").astype(datetime.datetime) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment