Skip to content

Instantly share code, notes, and snippets.

View JoeGermuska's full-sized avatar

Joe Germuska JoeGermuska

View GitHub Profile

After some discussion about how a map showing that half of US income can be attributed to the major metro areas, I wanted to see if I could work out how public assistance is distributed.

The American Community Survey has a table, B19067, Aggregate Public Assistance Income for Households, which tells the total amount of dollars in public assistance income that go to each geography. As you might guess, the biggest metro areas have the most dollars.

So I downloaded some CSVs from Census Reporter for all CBSA (metro/micropolitan) areas in the US:

@JoeGermuska
JoeGermuska / keybase.md
Created March 7, 2014 20:13
Keybase Proof

Keybase proof

I hereby claim:

  • I am JoeGermuska on github.
  • I am JoeGermuska (https://keybase.io/JoeGermuska) on keybase.
  • I have a public key whose fingerprint is A749 8790 8686 30C1 F76F 91F5 D6AD BFFD 3BB7 20C5

To claim this, I am signing this object:

@JoeGermuska
JoeGermuska / comm_zip_overlap.csv
Created June 6, 2014 15:30
ZIP Code to Chicago Community area coverage map.
zip area_number pct_covered
46320 52 5.65666700010227e-05
46320 55 0.000829988063627611
60007 76 0.0374161100203793
60018 76 0.537940977303293
60068 10 0.000114681511398346
60068 76 6.56825603108841e-06
60068 9 0.00048889250274846
60076 2 0.0021111871228966
60077 12 7.94752653466832e-07
@JoeGermuska
JoeGermuska / gist:38765a72d7b8d443c0ce
Created August 1, 2014 20:01
An attempt to identify tables suitable for use with interpolation method to compute a median for aggregated geographies.

See censusreporter/census-aggregate#1 (comment) for more info.

whee. I think this is a pretty good distillation of tables which might go through the aggregation process which are complicated... this needs more eyes for sure.

Apparent pairs suitable for interpolation B01001 Sex by age (repeat for racial iterations) B01002 Median age by sex

B05003 Sex by Age by Nativity and Citizenship Status B05004 Median Age by Nativity and Citizenship Status by Sex

I [tweeted](https://twitter.com/JoeGermuska/status/503183667624423424)
> I needed to convert these 58 pseudo-JSON files to real JSON. How would you do it?
> https://github.com/NUKnightLab/TimelineJS/tree/master/source/js/Core/Language/locale … (Kinda proud of my solution TBH)
Here's what I did.
Noah Veltman had [a much leaner solution](https://gist.github.com/veltman/8822eb9a25488c228a52) that used NodeJS. I'm not very savvy with Node, although I started down a solution like Noah's. I got stuck because I didn't consider changing the source files.
@JoeGermuska
JoeGermuska / README.md
Last active August 29, 2015 14:07
Debugging CGAL problem en route to brew install postgis

I was trying to brew install postgis and got an error on the cgal dependency.

It looks like maybe it has to do with boost, but according to the CGAL manual, I have a suitable Boost version (>1.39)

@JoeGermuska
JoeGermuska / gist:88eef44105c6f131139d
Created March 13, 2015 01:37
format backers as table
function make_row(ary) {
var tr = $("<tr>")
for (var i = 0; i < ary.length; i++) {
$(tr).append("<td>" + ary[i] + "</td>")
}
return tr;
}
cols = ['idx','backer_count','mystery','base_pledge','total_pledged']
var table = $('<table>');
$(table).append(make_row(cols));
@JoeGermuska
JoeGermuska / index.html
Last active August 29, 2015 14:20
Cities where Black median income is substantially higher than White median income
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>where_blacks_earn_more</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
@JoeGermuska
JoeGermuska / csvcut
Created September 14, 2009 21:01 — forked from bycoffe/csvcut
#!/usr/bin/env python
"""
Like cut, but for CSVs. To be used from a shell command line.
Note that fields are zero-based, as opposed to 'cut' where they are 1-based.
Leveraged from/motivated by an example from @bycoffe
Should use something better than getopt, but this works...
strfix <- function(s) {
s = gsub("(^ +)|( +$)", "", s)
s = sub("^(.*)$","\\U\\1",s, perl=TRUE)
return (s)
}