Skip to content

Instantly share code, notes, and snippets.

@overberger
Created April 17, 2015 00:59
Show Gist options
  • Save overberger/4636d2a881117bf4d2a4 to your computer and use it in GitHub Desktop.
Save overberger/4636d2a881117bf4d2a4 to your computer and use it in GitHub Desktop.
Fairfax County Hispanic pop by origin, ACS 2009-13, improved
We can make this file beautiful and searchable if this error is corrected: It looks like row 95 should actually have 32 columns, instead of 63 in line 94.
AreaName,TotalPop,NonHisp,HispTot,Mexican,PuertoRican,Cuban,Dominican (Dominican Republic),CentAmTot,CostaRican,Guatemalan,Honduran,Nicaraguan,Panamanian,Salvadoran,OtherCentAmTot,SouthAmTot,Argentinean,Bolivian,Chilean,Colombian,Ecuadorian,Paraguayan,Peruvian,Uruguayan,Venezuelan,OtherSouthAmTot,OtherHispTot,Spaniard,Spanish,SpanAmer,OtherHisp_Other
Tract 4825.01,8013,6662,1351,334,100,0,0,317,19,0,0,0,0,298,0,494,0,210,0,0,0,19,265,0,0,0,106,27,25,0,54
Tract 4316,7886,6949,937,57,83,0,0,214,0,43,0,0,0,171,0,583,4,429,0,0,10,0,140,0,0,0,0,0,0,0,0
Tract 4405.02,7408,6825,583,155,41,52,7,136,0,18,46,0,0,72,0,157,0,37,0,40,5,13,49,0,13,0,35,35,0,0,0
Tract 4605.02,7180,6406,774,23,37,15,27,202,0,0,0,0,60,142,0,458,12,0,37,71,14,0,313,11,0,0,12,0,0,0,12
Tract 4826.02,7069,6700,369,53,235,0,0,0,0,0,0,0,0,0,0,81,0,0,0,48,0,0,33,0,0,0,0,0,0,0,0
Tract 4911.03,7028,4983,2045,133,91,0,0,1029,0,251,0,0,0,778,0,417,0,247,0,0,0,22,148,0,0,0,375,0,375,0,0
Tract 4215,6904,4617,2287,956,93,0,0,916,0,18,15,39,118,726,0,216,79,89,0,0,0,0,48,0,0,0,106,0,51,0,55
Tract 4221.02,6676,5533,1143,482,28,16,18,142,0,0,28,0,0,114,0,457,41,352,0,0,64,0,0,0,0,0,0,0,0,0,0
Tract 4913.01,6648,5273,1375,142,254,0,0,627,0,11,0,0,0,616,0,352,211,0,0,0,0,0,141,0,0,0,0,0,0,0,0
Tract 4522,6615,4269,2346,106,150,7,0,1194,0,0,473,0,26,695,0,708,0,664,0,14,0,0,22,0,8,0,181,65,22,0,94
Tract 4221.01,6516,5561,955,69,99,0,28,493,0,71,47,0,0,375,0,242,0,0,0,12,19,0,0,0,211,0,24,0,0,0,24
Tract 4615,6434,5686,748,125,11,0,0,131,0,131,0,0,0,0,0,373,97,132,101,0,0,35,8,0,0,0,108,22,0,0,86
Tract 4402.02,6335,5314,1021,0,123,0,0,533,0,27,50,45,28,383,0,332,0,295,14,0,12,0,11,0,0,0,33,0,0,0,33
Tract 4920,6194,6031,163,0,1,0,0,1,0,0,1,0,0,0,0,103,0,0,0,34,0,0,17,0,52,0,58,58,0,0,0
Tract 4805.02,6042,5125,917,89,77,0,0,229,0,0,26,99,0,104,0,303,0,126,0,150,27,0,0,0,0,0,219,0,219,0,0
Tract 4817.01,5994,5880,114,11,44,0,0,0,0,0,0,0,0,0,0,43,0,0,7,25,0,0,11,0,0,0,16,0,16,0,0
Tract 4211.01,5950,5252,698,69,50,0,0,119,0,86,0,16,0,17,0,355,0,355,0,0,0,0,0,0,0,0,105,81,0,0,24
Tract 4526,5849,4303,1546,213,0,0,32,761,0,240,0,0,0,521,0,319,0,265,45,0,0,0,9,0,0,0,221,52,0,0,169
Tract 4916.02,5793,4388,1405,141,17,0,0,1043,12,0,29,0,0,1002,0,153,0,113,0,0,25,0,15,0,0,0,51,51,0,0,0
Tract 4901.03,5735,4648,1087,359,0,85,31,198,0,28,23,0,0,147,0,325,0,0,0,0,0,21,304,0,0,0,89,0,0,0,89
Tract 4516.01,5697,1385,4312,708,194,41,0,3067,0,1595,369,0,0,1103,0,292,0,266,0,26,0,0,0,0,0,0,10,0,0,0,10
Tract 4222.02,5654,4848,806,122,12,187,64,341,0,0,0,0,0,341,0,24,0,0,24,0,0,0,0,0,0,0,56,16,0,0,40
Tract 4325,5614,5111,503,92,68,138,0,38,0,17,0,0,0,21,0,144,0,65,0,0,0,0,68,11,0,0,23,10,0,0,13
Tract 4707,5592,5213,379,54,27,0,157,16,0,0,0,0,0,16,0,106,21,0,44,41,0,0,0,0,0,0,19,10,0,0,9
Tract 4216,5551,3383,2168,150,29,0,0,1889,0,5,402,28,11,1443,0,90,0,32,0,29,0,0,29,0,0,0,10,0,0,0,10
Tract 4407.02,5515,5176,339,111,4,0,0,120,0,38,21,0,0,61,0,65,0,41,14,10,0,0,0,0,0,0,39,39,0,0,0
Tract 4811.06,5473,5281,192,67,17,0,0,0,0,0,0,0,0,0,0,84,0,84,0,0,0,0,0,0,0,0,24,0,0,0,24
Tract 4223.02,5446,4872,574,198,86,0,14,77,0,0,56,0,0,21,0,166,0,0,0,102,0,0,45,0,19,0,33,0,14,0,19
Tract 4527,5359,3683,1676,184,41,43,0,903,0,179,253,40,8,423,0,478,0,305,10,62,36,0,54,0,11,0,27,27,0,0,0
Tract 4528.01,5340,4318,1022,16,92,45,0,140,0,0,16,25,0,99,0,667,30,570,33,23,11,0,0,0,0,0,62,0,18,0,44
Tract 4501,5271,4051,1220,16,16,0,0,177,0,127,0,0,0,50,0,1011,87,411,0,0,55,0,382,0,76,0,0,0,0,0,0
Tract 4302.02,5262,4719,543,58,110,28,0,213,0,28,0,0,0,185,0,116,0,36,23,22,0,0,35,0,0,0,18,7,0,0,11
Tract 4819,5226,4822,404,73,61,31,0,121,0,0,0,0,0,121,0,15,0,0,0,0,0,0,0,0,15,0,103,72,0,0,31
Tract 4224.02,5215,4487,728,35,56,0,0,572,0,200,49,21,60,242,0,14,0,14,0,0,0,0,0,0,0,0,51,51,0,0,0
Tract 4916.01,5179,3917,1262,0,43,0,0,991,0,201,0,29,0,761,0,228,22,153,0,0,0,0,53,0,0,0,0,0,0,0,0
Tract 4515.01,5139,3434,1705,224,9,37,123,695,0,153,0,0,0,542,0,520,11,229,43,9,0,0,228,0,0,0,97,0,0,0,97
Tract 4326,5092,4379,713,353,95,0,0,112,0,0,6,0,7,99,0,141,19,27,13,27,26,29,0,0,0,0,12,12,0,0,0
Tract 4825.03,5045,4926,119,0,29,0,0,53,0,9,44,0,0,0,0,14,0,0,0,14,0,0,0,0,0,0,23,23,0,0,0
Tract 4521.01,5004,4445,559,0,14,0,0,203,0,0,0,53,0,150,0,324,38,190,10,0,17,0,24,0,45,0,18,0,0,0,18
Tract 4405.01,4916,4470,446,78,115,17,0,116,0,14,0,0,0,102,0,91,0,20,0,0,0,0,57,14,0,0,29,11,0,0,18
Tract 4823.01,4864,4638,226,76,0,0,0,0,0,0,0,0,0,0,0,150,65,0,0,85,0,0,0,0,0,0,0,0,0,0,0
Tract 4158,4827,4477,350,109,98,8,0,10,0,10,0,0,0,0,0,103,0,0,8,71,0,0,24,0,0,0,22,14,0,0,8
Tract 4917.04,4814,4653,161,40,72,0,0,15,0,0,15,0,0,0,0,34,16,0,0,18,0,0,0,0,0,0,0,0,0,0,0
Tract 4515.02,4809,3408,1401,0,15,0,0,763,0,140,8,0,0,615,0,610,0,337,0,0,0,0,273,0,0,0,13,13,0,0,0
Tract 4712.02,4709,4053,656,344,159,20,0,84,0,6,45,12,0,21,0,0,0,0,0,0,0,0,0,0,0,0,49,49,0,0,0
Tract 4301.01,4696,4321,375,14,42,0,0,103,0,0,0,0,0,103,0,151,27,81,0,0,0,0,43,0,0,0,65,65,0,0,0
Tract 4309.01,4691,3827,864,14,37,0,0,502,0,154,117,0,0,231,0,297,110,58,0,0,0,0,0,0,129,0,14,14,0,0,0
Tract 4801,4644,4493,151,40,0,46,0,16,16,0,0,0,0,0,0,28,0,0,9,13,6,0,0,0,0,0,21,21,0,0,0
Tract 4601,4623,4450,173,6,45,71,0,7,0,7,0,0,0,0,0,44,27,9,8,0,0,0,0,0,0,0,0,0,0,0,0
Tract 4322.02,4600,3831,769,100,22,26,0,388,0,240,148,0,0,0,0,136,0,49,0,57,0,0,0,30,0,0,97,9,8,0,80
Tract 4924,4580,3904,676,30,69,12,0,92,0,0,6,0,24,62,0,412,40,154,40,35,0,0,143,0,0,0,61,24,31,0,6
Tract 4217.01,4544,2511,2033,36,118,0,0,1365,0,0,479,0,0,886,0,416,0,0,0,0,0,0,416,0,0,0,98,32,0,0,66
Tract 4507.02,4440,1981,2459,367,35,0,0,1201,0,416,118,0,0,667,0,749,0,322,0,0,12,0,320,0,95,0,107,18,0,0,89
Tract 4206,4408,3180,1228,149,9,25,0,906,0,0,165,0,8,733,0,128,0,0,0,52,0,0,76,0,0,0,11,0,0,0,11
Tract 4327.02,4366,3548,818,31,64,0,0,227,0,0,0,4,0,223,0,472,0,263,0,0,4,0,94,8,103,0,24,24,0,0,0
Tract 4925,4330,4227,103,16,0,0,0,62,0,0,0,0,0,62,0,6,0,0,0,0,0,0,6,0,0,0,19,19,0,0,0
Tract 4506.02,4294,2817,1477,29,62,0,0,373,0,28,0,0,0,345,0,999,136,224,52,74,33,115,288,0,77,0,14,14,0,0,0
Tract 4318.01,4210,3710,500,129,0,0,0,83,0,0,0,0,0,83,0,261,0,120,0,24,0,0,117,0,0,0,27,27,0,0,0
Tract 4201,4206,3211,995,26,57,9,0,686,0,56,214,0,0,416,0,206,0,125,0,0,9,0,62,0,10,0,11,0,0,0,11
Tract 4606,4190,3897,293,53,0,69,0,47,0,0,0,0,0,47,0,100,8,38,0,8,36,0,10,0,0,0,24,13,0,0,11
Tract 4802.01,4177,4156,21,0,0,0,0,0,0,0,0,0,0,0,0,11,0,11,0,0,0,0,0,0,0,0,10,10,0,0,0
Tract 4602,4151,4024,127,41,0,11,0,19,0,0,0,0,0,19,0,56,0,0,0,0,27,0,8,0,21,0,0,0,0,0,0
Tract 4525.01,4038,3058,980,19,2,16,0,236,0,152,0,0,0,84,0,648,0,620,0,0,0,0,24,4,0,0,59,0,0,0,59
Tract 4911.01,3987,3856,131,55,39,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,28,0,0,0,9,0,0,0,9
Tract 4308.02,3963,3387,576,54,31,12,35,169,0,22,0,51,80,16,0,242,21,60,13,39,0,0,46,0,47,16,33,16,0,0,17
Tract 4220,3881,3262,619,0,16,10,0,510,0,0,107,70,0,333,0,65,12,10,43,0,0,0,0,0,0,0,18,0,18,0,0
Tract 4713.03,3863,3468,395,27,106,0,0,121,0,0,0,0,0,121,0,121,0,33,0,0,26,0,62,0,0,0,20,20,0,0,0
Tract 4506.01,3842,3201,641,44,75,0,37,287,0,0,0,8,0,279,0,148,25,48,0,14,50,0,11,0,0,0,50,0,0,0,50
Tract 4207,3826,3130,696,143,61,34,0,282,0,10,0,0,0,272,0,176,0,67,0,0,0,12,97,0,0,0,0,0,0,0,0
Tract 4808.02,3810,3429,381,66,16,0,0,245,0,25,9,0,0,211,0,0,0,0,0,0,0,0,0,0,0,0,54,0,0,0,54
Tract 4714.01,3748,3052,696,0,0,0,0,303,0,22,23,15,0,243,0,333,0,203,0,78,0,0,26,0,0,26,60,0,54,0,6
Tract 4217.02,3729,2700,1029,57,0,0,0,762,18,0,92,0,0,652,0,150,0,0,0,47,0,0,103,0,0,0,60,0,16,0,44
Tract 4161,3703,3441,262,7,7,35,0,48,12,0,0,0,11,25,0,75,0,25,0,0,0,0,50,0,0,0,90,8,82,0,0
Tract 4151,3692,3047,645,106,0,0,0,373,0,0,39,0,0,334,0,141,0,9,30,55,0,0,0,0,47,0,25,0,25,0,0
Tract 4157,3676,3509,167,81,28,0,0,0,0,0,0,0,0,0,0,58,0,0,0,33,0,0,25,0,0,0,0,0,0,0,0
Tract 4911.02,3627,3039,588,96,24,0,0,400,0,400,0,0,0,0,0,68,0,23,0,0,0,0,45,0,0,0,0,0,0,0,0
Tract 4811.03,3597,3084,513,15,81,0,0,203,0,0,0,0,0,203,0,183,0,48,0,14,34,25,62,0,0,0,31,0,0,0,31
Tract 4222.01,3585,3229,356,9,83,18,0,68,0,0,51,0,0,0,17,151,0,0,0,40,0,0,99,0,0,12,27,0,0,0,27
Tract 4917.01,3557,3171,386,30,16,46,0,92,0,0,0,84,0,8,0,136,13,46,0,32,0,0,10,0,35,0,66,66,0,0,0
Tract 4321,3545,3269,276,21,13,0,0,141,7,16,66,0,9,43,0,74,0,35,0,39,0,0,0,0,0,0,27,0,27,0,0
Tract 4823.03,3512,3129,383,23,0,0,19,10,0,0,0,0,10,0,0,322,8,146,0,88,0,0,80,0,0,0,9,0,9,0,0
Tract 4208,3510,2534,976,33,51,43,0,599,0,0,0,12,0,587,0,193,0,161,0,9,0,0,23,0,0,0,57,0,57,0,0
Tract 4805.03,3488,2769,719,56,0,0,0,486,15,0,0,0,28,443,0,177,0,0,0,0,130,0,25,0,22,0,0,0,0,0,0
Tract 4816,3465,3239,226,47,0,8,0,11,0,0,0,11,0,0,0,24,0,0,0,0,20,0,0,0,4,0,136,0,130,0,6
Tract 4327.01,3428,3126,302,54,27,0,2,18,0,9,0,0,0,9,0,52,0,0,13,26,0,0,13,0,0,0,149,149,0,0,0
Tract 4324.01,3350,3134,216,53,95,0,0,68,0,0,4,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Tract 4811.02,3313,3059,254,11,80,0,55,66,0,0,0,0,0,66,0,42,0,0,0,0,0,0,42,0,0,0,0,0,0,0,0
Tract 4521.02,3301,2049,1252,24,27,1,0,191,0,6,0,0,0,185,0,994,57,771,0,0,0,0,166,0,0,0,15,15,0,0,0
Tract 4825.02,3234,2881,353,60,17,0,0,99,0,55,0,0,0,44,0,177,0,73,0,31,0,0,0,63,10,0,0,0,0,0,0
Tract 4159,3164,2681,483,237,83,0,0,129,14,7,0,0,0,108,0,34,7,0,11,0,0,7,9,0,0,0,0,0,0,0,0
Tract 4923,3139,2562,577,28,0,26,0,172,0,25,0,40,0,107,0,323,0,106,0,0,0,0,217,0,0,0,28,0,0,0,28
Tract 4905.01,3098,2577,521,0,8,8,14,298,0,18,0,18,0,262,0,185,0,10,0,0,0,0,166,0,9,0,8,8,0,0,0
Tract 4712.01,3082,2966,116,0,19,13,13,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,28,0,0,0,43,17,0,0,26
Tract 4914.05,3053,2885,168,39,116,0,0,0,0,0,0,0,0,0,0,4,0,3,0,0,0,1,0,0,0,0,9,9,0,0,0 Tract 4407.01,3039,2679,360,53,0,15,0,169,0,120,0,0,0,49,0,123,0,50,0,27,0,0,46,0,0,0,0,0,0,0,0
Tract 4204,3006,2347,659,126,103,22,7,225,0,0,17,0,0,208,0,135,0,54,21,0,0,0,18,7,35,0,41,0,0,0,41
Tract 4507.01,2902,2564,338,0,32,0,0,93,1,0,0,0,0,92,0,176,0,142,0,7,0,0,27,0,0,0,37,0,0,0,37
Tract 4219,2888,2528,360,229,57,31,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,22,5,0,0
Tract 4156,2851,2777,74,12,0,0,0,0,0,0,0,0,0,0,0,43,31,0,0,12,0,0,0,0,0,0,19,19,0,0,0
Tract 4302.03,2793,2505,288,18,41,0,0,114,0,33,0,0,81,0,0,104,0,29,0,55,0,0,20,0,0,0,11,5,0,0,6
Tract 4205.03,2738,2032,706,9,45,0,0,344,0,58,0,0,13,273,0,217,0,85,0,81,0,0,35,0,16,0,91,0,77,0,14
Tract 4322.01,2542,1919,623,22,19,49,0,331,21,89,0,0,0,206,15,202,27,134,0,0,0,0,41,0,0,0,0,0,0,0,0
Tract 4609,2376,2167,209,67,0,0,0,31,0,5,0,0,0,26,0,111,0,26,0,17,0,0,25,43,0,0,0,0,0,0,0
Tract 4815,2317,2222,95,9,13,10,0,5,0,0,5,0,0,0,0,49,0,0,0,35,0,0,14,0,0,0,9,0,6,0,3
Tract 4918.01,2141,1992,149,0,28,0,0,20,0,0,11,0,0,9,0,87,9,58,9,0,11,0,0,0,0,0,14,14,0,0,0
Tract 4805.04,2115,2030,85,0,32,0,0,0,0,0,0,0,0,0,0,53,0,0,0,33,0,0,20,0,0,0,0,0,0,0,0
Tract 4811.01,2082,1829,253,26,37,0,130,29,0,29,0,0,0,0,0,31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Tract 4163,1939,1847,92,45,0,0,0,7,0,0,7,0,0,0,0,40,0,0,0,0,29,0,0,11,0,0,0,0,0,0,0
Tract 4713.04,1796,1712,84,0,0,0,0,23,0,0,0,0,0,23,0,47,0,21,0,22,0,0,4,0,0,0,14,0,9,0,5
Tract 4912.02,1698,1505,193,6,70,0,0,47,0,0,0,0,0,47,0,55,0,0,0,13,0,0,42,0,0,0,15,0,15,0,0
Tract 4205.01,1641,1552,89,14,28,0,0,0,0,0,0,0,0,0,0,47,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0
Tract 4205.02,1586,1416,170,12,6,3,0,134,0,0,0,14,20,100,0,15,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0
Tract 4812.01,1324,1296,28,11,11,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fairfax County</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: white;
font-family: Helvetica, Arial, sans-serif;
}
h1 {
font-size: 28px;
margin: 0;
}
p {
font-size: 14px;
margin: 10px 0 0 0;
}
svg {
background-color: LightGray;
}
rect:hover {
fill: goldenrod;
}
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.axis text {
font-family: sans-serif;
font-size: 7.5px;
}
.y.axis path,
.y.axis line {
opacity: 0;
}
</style>
</head>
<body>
<h1>Fairfax County Hispanic Diversity</h1>
<p>Total Hispanic population; ACS 2009-13. Source : <a href="http://factfinder.census.gov/bkmk/table/1.0/en/ACS/13_5YR/B03001/0500000US51059.14000"> U.S. Census Bureau</a>, 2009-13</p>
<script type="text/javascript">
var w = 750;
var h = 800;
var padding = [ 20, 20, 20, 60 ];
var widthScale = d3.scale.linear()
.range([ 0, w - padding[1] - padding[3] ]);
var heightScale = d3.scale.ordinal()
.rangeRoundBands([ padding[0], h - padding[2] ], 0.1);
var xAxis = d3.svg.axis()
.scale(widthScale)
.orient("bottom");
var yAxis = d3.svg.axis()
.scale(heightScale)
.orient("left");
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);
d3.csv("FairfaxHispanic.csv", function(data) {
data.sort(function(a, b) {
return d3.descending(+a.HispTot, +b.HispTot);
});
widthScale.domain([ 0, d3.max(data, function(d) {
return +d.HispTot;
}) ]);
heightScale.domain(data.map(function(d) { return d.AreaName; } ));
var rects = svg.selectAll("rect")
.data(data)
.enter()
.append("rect");
rects.attr("x", padding[3])
.attr("y", function(d) {
return heightScale(d.AreaName);
})
.attr("width", function(d) {
return widthScale(d.HispTot);
})
.attr("height", heightScale.rangeBand())
.attr("fill", "Steelblue")
.append("title")
.text(function(d) {
return d.AreaName + "'s Hispanic total is " + d.HispTot;
});
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(" + padding[3] + "," + (h - padding[2]) + ")")
.call(xAxis);
svg.append("g")
.attr("class", "y axis")
.attr("transform", "translate(" + padding[3] + ",0)")
.call(yAxis);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment