Last active
October 18, 2017 11:29
-
-
Save linwoodc3/5c915fb6d9097e7e27d5b0bc1f047ba2 to your computer and use it in GitHub Desktop.
Get a timezone string from a latitude and longitude pair for timezone normalization.
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
# Created by: Linwood Creekmore III | |
# [email protected] | |
from tzwhere import tzwhere | |
tz = tzwhere.tzwhere() | |
import numpy as np | |
def getT(x): | |
try: | |
latitude=x[1] | |
longitude =x[2] | |
yield tz.tzNameAt(latitude,longitude) | |
except: | |
yield np.nan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment