Skip to content

Instantly share code, notes, and snippets.

View hancush's full-sized avatar
🍓

hannah cushman garland hancush

🍓
View GitHub Profile
<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSeTcW7T-iNX26MU1FzqfPXKXe3Vqzg8dvztrOVqC7dDKtomdzF3MrvUspgXEiEsEAY3ii0KdDPVvzy/pubhtml?gid=0&amp;single=true&amp;widget=true&amp;headers=false"></iframe>
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 4. in line 1.
Candidate,Votes Total,Votes Percent
"Anthony ""Tony"" Ciaravino",0,0.0,
Ambria Taylor,0,0.0,
"Elvira ""Vida"" Jimenez",0,0.0,
Nicole Lee,0,0.0,
"Froylan ""Froy"" Jimenez",0,0.0,
Steve Demitro,0,0.0,
Don Don,0,0.0,
0 of 23 precincts reporting,,
---
title: "Geocoding template"
output: html_notebook
---
# Instructions
- Upload your file to the data/ directory of this workspace by clicking Upload in the menu bar of the file browser in the lower right pane. Make note of the name of the column containing the addresses you want to geocode.
- Follow these instructions to get an API key for the Google Geocoding API in the Google Console: https://developers.google.com/maps/documentation/geocoding/cloud-setup
- N.b., You have to set up a billing account to use the Google Geocoding API. See details on pricing here: https://developers.google.com/maps/documentation/geocoding/usage-and-billing#pricing-for-product
@hancush
hancush / lowes.csv
Last active May 18, 2022 20:49
👷 lowe's locations scraped from http://lowes.know-where.com/lowes/cgi/index
store_name store_number address city state zip_code
LOWE'S OF ALABASTER, AL 2525 235 COLONIAL PROMENADE PARKWAY ALABASTER AL 35007
LOWE'S OF N. ANNISTON, AL 2659 4901 MCCLELLAN BOULEVARD ANNISTON AL 36206
LOWE'S OF ATHENS, AL 1799 1109 US HIGHWAY 72 EAST ATHENS AL 35611
LOWE'S OF BESSEMER, AL 1531 1201 19TH STREET NORTH BESSEMER AL 35020
LOWE'S OF TRUSSVILLE, AL 0594 1885 EDWARDS LAKE RD. BIRMINGHAM AL 35235
LOWE'S OF INVERNESS, AL 1726 5291 HIGHWAY 280 BIRMINGHAM AL 35242
LOWE'S OF CULLMAN, AL 0313 1717 CHEROKEE AVENUE, SW CULLMAN AL 35055
LOWE'S OF DAPHNE, AL 2251 29645 FREDERICK BOULEVARD DAPHNE AL 36526
LOWE'S OF DECATUR, AL 1176 1641 BELTLINE ROAD SW DECATUR AL 35601

My R Version:

call-me-hank:analysis-drug-charges hannah$ Rscript --version
R scripting front-end version 4.0.0 (2020-04-24)

After the first round of errors, I uninstalled everything using uninstall.R, then ran install.R. (Both are attached to this gist, for reference.) Here are some excerpts from the output.

Seems like a few packages are not available

$(patsubst %, pensions_%.reordered.csv, $(shell seq 2012 1 2017)) : data/raw/pensions_2012-2017.csv
# some other operations on the downloaded/inflated pensions data
data/raw/pensions_%.csv : data/raw/pensions_%.tar
cd $(dir $@) && tar xvfz $(notdir $<)
data/raw/pensions_%.tar :
wget --no-use-server-timestamps \
https://bga-pensions-database.s3.amazonaws.com/raw/$(notdir $@) -O $@
response = requests.post(some_post_data)
response_data = json.loads(response.data.decode('utf-8'))
print(response_data)
# {
# "status": "ok",
# "matches": [
# {
from lxml import etree
html = '''
<h3>Offense: A Tale of Two Halves</h3>
<p>For a while there, it seemed the Bears' offense might never show up in London. The unit generated just two first downs and 44 total yards in the first half. Then <strong>Chase Daniel</strong> s
tarted hitting his spots, aided with some stellar work by <strong>Allen Robinson</strong> and <strong>Anthony Miller</strong>, to get the rally going. Unfortunately, it was too little, too late wi
th the defense not playing at its best.</p>
<h5>By the numbers:</h5>
<ul>
<li><strong>194 PASSING YARDS:</strong> Daniel had some good moments in completing 22 of 30 passes for 231 yards, but <a href="https://chicago.suntimes.com/bears/2019/10/6/20901945/daniel-takes-th
Employer ID
City of Chicago 16
Chicago 16
Metropolitan Pier and Exposition Authority 53
Metropolitan Pier Exposition Authority 53
Third Lake 364
Village Of Third Lake 364
Fox Valley Park District 519
Fox Valley Park District 519
Homewood Flossmoor Park District 541
# usage: python interval.py /path/to/your/file.csv
import csv
import sys
import re
def days_from_interval(interval):
if interval == 'never':
return None