From 16839698d4909114e2229d789d0f72f0ef57a1bc Mon Sep 17 00:00:00 2001 From: Jason Pack Date: Wed, 13 Apr 2016 17:34:58 -0400 Subject: [PATCH 1/2] Update census_geo.py fixed this strings thing for mpazoles, hopefully --- census_geo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/census_geo.py b/census_geo.py index feccd5d..914d60a 100644 --- a/census_geo.py +++ b/census_geo.py @@ -23,6 +23,7 @@ def geocode(x): files = {'addressFile': ''.join(data_chunks[i])} response = requests.post(url, data=census_year, files=files) for block in response.iter_content(1024): + block = block.decode() buff.write(block) outraw = buff.getvalue() cnames = ['id_number', 'input_address', 'match_status', 'match_type', 'matched_address', 'lonlat', 'tigerline_id', 'street_orientation'] From 4bb1874754e12cd8dc3a1045be59cbe6514f04fe Mon Sep 17 00:00:00 2001 From: Jason Pack Date: Wed, 13 Apr 2016 17:42:04 -0400 Subject: [PATCH 2/2] Update census_geo.py --- census_geo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/census_geo.py b/census_geo.py index 914d60a..5e5f530 100644 --- a/census_geo.py +++ b/census_geo.py @@ -25,7 +25,7 @@ def geocode(x): for block in response.iter_content(1024): block = block.decode() buff.write(block) - outraw = buff.getvalue() + outraw = buff.getvalue().strip() cnames = ['id_number', 'input_address', 'match_status', 'match_type', 'matched_address', 'lonlat', 'tigerline_id', 'street_orientation'] df = pd.read_csv(StringIO(outraw), names=cnames, sep=',') #add malformed file handling