Skip to content

Instantly share code, notes, and snippets.

@linwoodc3
Last active October 18, 2017 11:29
Show Gist options
  • Save linwoodc3/5c915fb6d9097e7e27d5b0bc1f047ba2 to your computer and use it in GitHub Desktop.
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.
# Created by: Linwood Creekmore III
# valinvescap@gmail.com
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