Skip to content

Instantly share code, notes, and snippets.

View natemiller's full-sized avatar

Nate Miller (he/him) natemiller

View GitHub Profile
@natemiller
natemiller / SF_EvictionNotices_Total_Wide.csv
Created December 8, 2015 07:33
SF_EvictionNotices_Raw
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 42 columns, instead of 11. in line 4.
Year,Bayview_Hunters_Point,Bernal_Heights,Castro_and_Upper_Market,Chinatown,Excelsior,Financial_District_and_South_Beach,Glen_Park,Golden_Gate_Park,Haight_Ashbury,Hayes_Valley,Inner_Richmond,Inner_Sunset,Japantown,Lakeshore,Lincoln_Park,Lone_Mountain_and_USF,Marina,McLaren_Park,Mission,Mission_Bay,Nob_Hill,Noe_Valley,North_Beach,Oceanview_Merced_and_Ingleside,Outer_Mission,Outer_Richmond,Pacific_Heights,Portola,Potrero_Hill,Presidio,Presidio_Heights,Russian_Hill,Seacliff,South_of_Market,Sunset_Parkside,Tenderloin,Treasure_Island,Twin_Peaks,Visitacion_Valley,West_of_Twin_Peaks,Western_Addition
1997,25,95,152,11,56,5,15,NA,116,96,116,72,7,71,3,93,85,NA,265,2,81,84,42,33,31,140,77,22,45,1,35,71,3,34,147,52,2,27,20,53,44
1998,57,84,138,23,74,13,37,NA,102,167,71,106,7,87,1,77,110,NA,329,1,61,121,69,60,40,146,90,64,64,NA,34,72,2,40,200,56,NA,21,31,65,25
1999,80,69,133,22,71,52,31,NA,98,103,67,81,3,65,NA,62,79,NA,297,NA,58,85,86,39,49,124,70,31,69,NA,44,79,4,58,178,55,1,16,21,44,51
2000,78,85,93,23,72,17,20,NA,98,13
@natemiller
natemiller / index.html
Last active December 6, 2015 21:01
Top 50 CA College Debt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CA College Debt</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
@natemiller
natemiller / CA_temps_C_anomaly.csv
Last active September 27, 2015 23:10
California Annual Maximum and Minimum Temperatures 1895-2014
Year Anomaly in Annual Minimum Temperature Anomaly in Annual Maximum Temperature
1895 -0.527777778 -0.677777778
1896 0.011111111 -0.444444444
1897 -0.416666667 -0.738888889
1898 -0.661111111 -0.383333333
1899 -0.494444444 -0.616666667
1900 0.011111111 -0.277777778
1901 -0.283333333 -0.377777778
1902 -0.672222222 -0.855555556
1903 -0.877777778 -0.366666667
@natemiller
natemiller / Education_Poverty.csv
Created September 22, 2015 19:20
d3: Education and Poverty Scatterplot/ with mouseover data
state non_math_prof child_pov year
United_States 71.5 18.5 2005
Alabama 84.8 24.8 2005
Alaska 71.3 14.5 2005
Arizona 74.3 20.3 2005
Arkansas 78.0 24.9 2005
California 78.2 18.6 2005
Colorado 68.0 14.2 2005
Connecticut 65.4 11.6 2005
Delaware 70.3 14.5 2005
@natemiller
natemiller / Education_Poverty.csv
Last active March 7, 2016 16:55
d3:Education/Poverty_Tooltip
state non_math_prof child_pov year math_proficient
United_States 71.5 18.5 2005 28.5
Alabama 84.8 24.8 2005 15.2
Alaska 71.3 14.5 2005 28.7
Arizona 74.3 20.3 2005 25.7
Arkansas 78 24.9 2005 22
California 78.2 18.6 2005 21.8
Colorado 68 14.2 2005 32
Connecticut 65.4 11.6 2005 34.6
Delaware 70.3 14.5 2005 29.7
@natemiller
natemiller / Education_Poverty.csv
Last active September 21, 2015 05:01
d3: Poverty and Educational Outcomes Scatterplot
United_States 71.5 18.5 2005
Alabama 84.8 24.8 2005
Alaska 71.3 14.5 2005
Arizona 74.3 20.3 2005
Arkansas 78.0 24.9 2005
California 78.2 18.6 2005
Colorado 68.0 14.2 2005
Connecticut 65.4 11.6 2005
Delaware 70.3 14.5 2005
@natemiller
natemiller / SF_EvictionNoticesPer1000Household_Total_Wide.csv
Last active December 8, 2015 07:29
SF Eviction Multiline Plot Per 1000 Households - d3.js
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 35 columns, instead of 12. in line 2.
Year,Bayview_Hunters_Point,Bernal_Heights,Castro-Upper_Market,Chinatown,Excelsior,Financial_District-South_Beach,Glen_Park,Haight_Ashbury,Western_Addition,Inner_Richmond,Inner_Sunset,Lakeshore,Marina,Mission,Mission_Bay,Nob_Hill,Noe_Valley,North_Beach,Oceanview-Merced-Ingleside,Outer_Mission,Outer_Richmond,Pacific_Heights,Portola,Potrero_Hill,Presidio,Presidio_Heights,Russian_Hill,Seacliff,South_of_Market,Parkside,Tenderloin-Civic_Center,Twin_Peaks,Visitacion_Valley,West_of_Twin_Peaks
1997,2.637130802,10.35986914,11.00651702,1.636904762,8.337055233,3.086419753,3.937007874,11.18611379,6.818181818,12.04610951,6.212251941,11.77446103,6.533435819,11.94231636,0.913242009,8.265306122,7.387862797,5.46875,5.007587253,3.914141414,11.11111111,7.571288102,7.711181213,7.745266781,1.136363636,7.641921397,7.38045738,6.060606061,3.011514615,21.42857143,2.410755679,27,3.853564547,4.849039341
1998,6.012658228,9.160305344,9.99275887,3.422619048,11.01682299,8.024691358,9.711286089,9.836065574,9.230055659,8.530259366,9.145815358
@natemiller
natemiller / SF_EvictionNotices.csv
Last active August 31, 2015 20:20
d3.js SF Eviction Notice Barplot Example
Year Neighborhood Capital.Improvement Nuisance Owner.Move.In Ellis.Act.WithDrawal Breach Late.Payments Non.Payment Roommate.Same.Unit Demolition Condo.Conversion Access.Denial Illegal.Use Other.Cause Unapproved.Subtenant Failure.to.Sign.Renewal Substantial.Rehab Development Lead.Remediation Total
1997 Bayview Hunters Point 0 3 8 0 3 2 1 3 0 0 0 0 5 0 0 0 0 0 25
1997 Bernal Heights 0 4 63 0 7 7 1 3 3 0 0 1 6 0 0 0 0 0 95
1997 Castro/Upper Market 4 8 84 0 17 6 7 9 1 0 0 0 12 4 0 0 0 0 152
1997 Chinatown 0 6 3 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 11
1997 Excelsior 0 0 32 0 3 1 14 0 0 0 0 0 5 1 0 0 0 0 56
1997 Financial District/South Beach 0 0 0 0 2 2 0 0 1 0 0 0 0 0 0 0 0 0 5
1997 Glen Park 0 0 11 0 2 0 0 0 1 0 0 0 1 0 0 0 0 0 15
1997 Haight Ashbury 0 6 69 0 8 2 4 7 4 0 0 0 10 6 0 0 0 0 116
1997 Hayes Valley 0 10 30 0 17 5 12 6 1 0 1 0 5 9 0 0 0 0 96
@natemiller
natemiller / SF_EvictionNotices.csv
Last active August 29, 2015 14:28
SF Eviction Notice Data: Loading with d3js example
Year Neighborhood Capital.Improvement Nuisance Owner.Move.In Ellis.Act.WithDrawal Breach Late.Payments Non.Payment Roommate.Same.Unit Demolition Condo.Conversion Access.Denial Illegal.Use Other.Cause Unapproved.Subtenant Failure.to.Sign.Renewal Substantial.Rehab Development Lead.Remediation Total
1997 Bayview Hunters Point 0 3 8 0 3 2 1 3 0 0 0 0 5 0 0 0 0 0 25
1997 Bernal Heights 0 4 63 0 7 7 1 3 3 0 0 1 6 0 0 0 0 0 95
1997 Castro/Upper Market 4 8 84 0 17 6 7 9 1 0 0 0 12 4 0 0 0 0 152
1997 Chinatown 0 6 3 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 11
1997 Excelsior 0 0 32 0 3 1 14 0 0 0 0 0 5 1 0 0 0 0 56
1997 Financial District/South Beach 0 0 0 0 2 2 0 0 1 0 0 0 0 0 0 0 0 0 5
1997 Glen Park 0 0 11 0 2 0 0 0 1 0 0 0 1 0 0 0 0 0 15
1997 Haight Ashbury 0 6 69 0 8 2 4 7 4 0 0 0 10 6 0 0 0 0 116
1997 Hayes Valley 0 10 30 0 17 5 12 6 1 0 1 0 5 9 0 0 0 0 96
@natemiller
natemiller / SF Eviction Notice.md
Last active August 29, 2015 14:27
Eviction Notices in San Francisco grouped by Year, Neighborhood, and Justification (1997-2015)

Here is a dataset from data.sfgov.org (https://data.sfgov.org/Housing-and-Buildings/2012-Housing-Inventory/4xa2-t52k) which included data regarding eviction notices in San Franciso from 1997 to 2015. I have cleaned and reorganized the data using R (code shown at bottom, below data) for this particular example so that it includes columns for the year of the eviction notice (there is also data for month and day), the neighborhood (there is also data regarding zipcode, as well as, city block address), the justification for the eviction, and the number of instances of that particular justification in that year/neighborhood.

The larger dataset is very interesting, but I reduced it so that it might be possible to see trends in eviction justifications over time in different neighborhoods. It might also be useful to condense this data further by summing across justificaions to look at total eviction notices per year in each neighborhood.

###Note: These are eviction notices and may not represent actual evictions.