This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bonus example: | |
The IPUMS SDA query interface allows you to collapse variables into broader categories. I do this often with occupations -- individual occupations are usually too small to carry a meaningful sample size, but if you look at the occupational hierarchy in the docs, you can see how you might tile up individual occupations into broader but still meaningful categories. | |
So try this. | |
1) Pick any sample to query | |
2) put sex as your column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The correct 'link': | |
<div class='map-navigation' data-zoom='12' data-position='<%=d.tractlat%>,<%=d.tractlon%>'>Zoom</div> | |
The 'link' that zoomed but then reloaded page: | |
<div class='map-navigation'><a href='' data-zoom='12' data-position='<%=d.tractlat%>,<%=d.tractlon%>'>Zoom</a></div> | |
The zoomer function: | |
document.querySelector('.map-navigation').onclick = function(abc) { | |
var pos = abc.target.getAttribute('data-position'); | |
var zoom = abc.target.getAttribute('data-zoom'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2010-2014, ACS 5-year sample | |
Source: IPUMS.org | |
Nativer American Alone, by Tribal Identification | |
302: Apache 70,940 | |
303: Blackfoot 28,256 | |
304: Cherokee 279,721 | |
305: Cheyenne 14,386 | |
306: Chickasaw 23,110 | |
307: Chippewa 114,423 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT dob, SUBSTRING_INDEX( `dob` , '/', 1 ) AS mo, | |
SUBSTRING_INDEX(SUBSTRING_INDEX( `dob` , '/', 2 ),'/',-1) AS dy, | |
SUBSTRING_INDEX(SUBSTRING_INDEX( `dob` , '/', 3 ),'/',-1) AS yr, | |
CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX( `dob` , '/', 3 ),'/',-1),"-",SUBSTRING_INDEX( `dob` , '/', 1 ),"-",SUBSTRING_INDEX(SUBSTRING_INDEX( `dob` , '/', 2 ),'/',-1)) AS dt | |
FROM table | |
"dob" "mo" "dy" "yr" "dt" | |
"7/19/1970" "7" "19" "1970" "1970-7-19" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib.colors import LinearSegmentedColormap | |
bins = [0,1] | |
# Maps values to a bin. | |
# The mapped values must start at 0 and end at 1. | |
def bin_mapping(x): | |
for idx, bound in enumerate(bins): | |
if x < bound: | |
return idx / (len(bins) - 1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These 74 nursing homes with HUD-backed mortgages appeared recently a Congressional list of facilities that have “serious deficiencies.” |
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geoid,pop_density,paved_density,tract_type | |
01001020100,3,3,3) OUTER RING | |
01001020200,5,5,3) OUTER RING | |
01001020300,5,4,3) OUTER RING | |
01001020400,5,4,3) OUTER RING | |
01001020500,6,6,2) INNER RING | |
01001020600,4,4,3) OUTER RING | |
01001020700,3,3,3) OUTER RING | |
01001020801,2,2,4) RURAL | |
01001020802,2,2,4) RURAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
statename | countyfips | countyname | urban | inner | outer | rural | total | urban_pct | isuburb_pct | osuburb_pct | |
---|---|---|---|---|---|---|---|---|---|---|---|
al01 | 01001 | Autauga County | 0 | 9965 | 18709 | 26362 | 55036 | 0 | 0.18106330401918744 | 0.3399411294425467 | |
al01 | 01003 | Baldwin County | 0 | 0 | 149067 | 54293 | 203360 | 0 | 0 | 0.7330202596380803 | |
al01 | 01005 | Barbour County | 0 | 0 | 6045 | 20156 | 26201 | 0 | 0 | 0.23071638487080645 | |
al01 | 01007 | Bibb County | 0 | 0 | 0 | 22580 | 22580 | 0 | 0 | 0 | |
al01 | 01009 | Blount County | 0 | 0 | 0 | 57667 | 57667 | 0 | 0 | 0 | |
al01 | 01011 | Bullock County | 0 | 0 | 0 | 10478 | 10478 | 0 | 0 | 0 | |
al01 | 01013 | Butler County | 0 | 0 | 4368 | 15758 | 20126 | 0 | 0 | 0.21703269402762596 | |
al01 | 01015 | Calhoun County | 1197 | 3854 | 82703 | 27773 | 115527 | 0.010361214261601184 | 0.03336016688739429 | 0.7158759424203865 | |
al01 | 01017 | Chambers County | 0 | 0 | 12473 | 21422 | 33895 | 0 | 0 | 0.36798937896444905 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"isHealth=ifelse((IND>=7970 & IND<=8290) | (OCC>=3000 & OCC<=3550),1,0), | |
isHealth=ifelse(OCC==3250 |OCC==3424, 0, isHealth)," "Offices of physicians | |
Offices of dentists | |
Offices of chiropractors | |
Offices of optometrists | |
Offices of other health practitioners | |
Outpatient care centers | |
Home health care services | |
Other health care services | |
General medical and surgical hospitals, and specialty (except psychiatric and substance abuse) hospitals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Occupation,workers,Female,NonWhite,Black,Hispanic,Asian,ForeignBorn-Citizen,ForeignBorn-NonCitizen | |
Registered nurses,"3,171,358",89%,29%,11%,7%,9%,12%,3% | |
Nursing assistants,"1,369,106",89%,57%,34%,14%,5%,14%,9% | |
Physicians,"882,804",38%,35%,5%,6%,21%,21%,7% | |
Licensed practical and licensed vocational nurses,"863,026",87%,45%,26%,12%,5%,10%,4% | |
Personal care aides,"720,868",84%,56%,27%,18%,8%,12%,11% | |
Medical and health services managers,"631,539",72%,30%,12%,10%,5%,9%,3% | |
Medical assistants,"497,345",92%,49%,13%,29%,4%,10%,5% | |
"Secretaries and administrative assistants, except legal, medical, and executive","470,105",96%,30%,11%,13%,4%,7%,3% | |
Receptionists and information clerks,"459,777",95%,39%,11%,21%,4%,6%,4% |
OlderNewer