Updates

Data is not being refreshed every 10 minutes. That might be too soon.

Updated the read. If lat and lng do not come in as strings, there will be rounding errors. This makes a difference when doing deltas with time updates.

#!/usr/bin/env python

import requests
import pandas as pd
import io
import datetime

# Read in the data
def readTZ():
url=
"https://storage.googleapis.com/montco-stats/tz.csv"
d=requests.get(url).content
d=pd.read_csv(io.StringIO(d.decode(
'utf-8')),
header=
0,names=['lat', 'lng','desc','zip','title',
'timeStamp','twp','e'],
dtype={
'lat':str,'lng':str,'desc':str,'zip':str,
'title':str,'timeStamp':datetime.datetime,'twp':str,'e':int})
d=pd.DataFrame(d)
return d

d=readTZ()
blog comments powered by Disqus