Skip to content

Instantly share code, notes, and snippets.

View rambler's full-sized avatar

Ian Alderman rambler

View GitHub Profile
import re
non_alpha = re.compile('[^a-zA-Z]')
def word_generator(file_name):
with open(file_name, 'r') as file:
for line in file.readlines():
line = non_alpha.sub(' ', line).lower()
for word in line.split():
yield word

Keybase proof

I hereby claim:

  • I am rambler on github.
  • I am ianalderman (https://keybase.io/ianalderman) on keybase.
  • I have a public key whose fingerprint is 0790 A150 0DC8 8455 02B6 20A5 AE02 C773 0B09 E4AB

To claim this, I am signing this object:

@rambler
rambler / State_merged.json
Last active August 29, 2015 14:21
Homelessness over time in the USA
{
"AK": {
"2007": {
"total_homeless": "1642",
"sheltered_homeless": "1387",
"unsheltered_homeless": "255",
"homeless_individuals": "1062",
"sheltered_homeless_individuals": "891",
"unsheltered_homeless_individuals": "171",
"homeless_people_in_families": "580",
@rambler
rambler / combined.csv
Created April 24, 2015 04:47
Homeless By State, 2014 vs Estimated Population (m5)
state census homeless percent_homeless
Alabama 4849377 4561 0.0009405331860154407
Alaska 736732 1784 0.002421504699130756
Arizona 6731484 10495 0.0015590915762408407
Arkansas 2966369 2936 0.0009897622311991529
California 38802500 113952 0.002936717994974551
Colorado 5355866 10028 0.001872339599235679
Connecticut 3596677 4450 0.0012372531645182484
Delaware 935614 901 0.0009630039738610153
Florida 19893297 41542 0.0020882410793947328
@rambler
rambler / homeless_by_state_2014.csv
Created April 22, 2015 11:59
Week 4: Homelessness by State
state total2014
AK 1784
AL 4561
AR 2936
AZ 10495
CA 113952
CO 10028
CT 4450
DC 7748
DE 901
@rambler
rambler / homeless_by_state_2014.csv
Created April 14, 2015 02:18
Homelessness by state in the USA
state year_2014
AK 1784
AL 4561
AR 2936
AZ 10495
CA 113952
CO 10028
CT 4450
DC 7748
DE 901
@rambler
rambler / index.html
Last active August 29, 2015 14:17
Aggregate information about homelessness in the USA by state over time + random gray dots.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loading CSV Data with D3</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
</head>
<body>
<p>Random grey dots: Some code here borrowed from the awesome <a href="http://jfire.io/animations/">John Firebaugh</a>.</p>
@rambler
rambler / combined_pit_counts.csv
Last active August 29, 2015 14:17
Homelessness in the USA
coc year chronically_homeless chronically_homeless_individuals chronically_homeless_people_in_families homeless_individuals homeless_people_in_families homeless_unaccompanied_children homeless_unaccompanied_young_adults homeless_unaccompanied_youth_and_children homeless_veterans sheltered_chronically_homeless sheltered_chronically_homeless_individuals sheltered_chronically_homeless_people_in_families sheltered_homeless sheltered_homeless_individuals sheltered_homeless_people_in_families sheltered_homeless_unaccompanied_children sheltered_homeless_unaccompanied_young_adults sheltered_homeless_unaccompanied_youth_and_children sheltered_homeless_veterans total_homeless unsheltered_chronically_homeless unsheltered_chronically_homeless_individuals unsheltered_chronically_homeless_people_in_families unsheltered_homeless unsheltered_homeless_individuals unsheltered_homeless_people_in_families unsheltered_homeless_unaccompanied_children unsheltered_homeless_unaccompanied_young_adults unsheltered_homeless_unaccompanie
@rambler
rambler / combined_pit_counts.csv
Last active August 29, 2015 14:17
Data for D3 course: Homelessness in USA by location and time
async.filterSeries(questions,
policyEval(req.params.uid),
function(results) {