{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "%pylab --no-import-all inline" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from pandas import DataFrame, Series, Index\n", "import pandas as pd" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "import census\n", "import us\n", "\n", "import settings" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The census documentation has example URLs but needs your API key to work. In this notebook, we'll use the IPython notebook HTML display mechanism to help out.\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "c = census.Census(key=settings.CENSUS_KEY)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "http://www.census.gov/developers/data/sf1.xml\n", "\n", "compare to http://www.census.gov/prod/cen2010/briefs/c2010br-02.pdf \n", "\n", "I think the P0050001 might be the key category\n", "\n", "* P0010001 = P0050001\n", "* P0050001 = P0050002 + P0050010\n", "\n", "P0050002 Not Hispanic or Latino (total) = \n", "\n", "* P0050003 Not Hispanic White only \n", "* P0050004 Not Hispanic Black only\n", "* P0050006 Not Hispanic Asian only\n", "* Not Hispanic Other (should also be P0050002 - (P0050003 + P0050004 + P0050006)\n", " * P0050005 Not Hispanic: American Indian/ American Indian and Alaska Native alone\n", " * P0050007 Not Hispanic: Native Hawaiian and Other Pacific Islander alone\n", " * P0050008 Not Hispanic: Some Other Race alone\n", " * P0050009 Not Hispanic: Two or More Races\n", "\n", "* P0050010 Hispanic or Latino\n", " \n", "P0050010 = P0050011...P0050017\n", "\n", "\"Whites are coded as blue; African-Americans, green; Asians, red; Hispanics, orange; and all other racial categories are coded as brown.\"" ] }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Planned for next week" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We will be calculating for each of the following geographic entities:\n", "\n", " * states\n", " * counties\n", " * places\n", " * metropolitan areas\n", " * combined statistical areas\n", "\n", "these quantities:\n", "\n", " * the total number of Hispanics/Latinos vs non-Hispanics/Latinos\n", " * numbers of people in the categories found in the [Racial Dot Map](http://bit.ly/rdotmap)\n", " * the diversity index \n", " \n", "With any luck, we'll also plot quantities on maps too.\n" ] } ], "metadata": {} } ] }