Code Monkey home page Code Monkey logo

acs_tools's Introduction

Warning: Still under construction.

Objective: Tools for making extraction of Census Bureau data easier 

For example, to get income values by census tract which were estimated from the
Amercian Community Survey (ACS):

    >>> import numpy
    >>> import pyACS
    >>> table = pyACS.ACS(pyACS.sumlevel.TRACT)
    >>> len(table)
    74002 
    >>> c = table['B19013001'] # Median Household Income
    >>> c = numpy.nan_to_num(c)
    >>> round(c.mean())
    54404.0
    >>> numpy.median(c)
    49028.0

But first you need to download and install the census data....

    $ mkdir /pyacs
    $ cd /pyacs
    $ wget "http://www2.census.gov/acs2011_5yr/summaryfile/2007-2011_ACSSF_All_In_2_Giant_Files(Experienced-Users-Only)/Tracts_Block_Groups_Only.tar.gz"
    $ tar xfz Tracts_Block_Groups_Only.tar.gz
    $ mv group2 SUMFILE

The downloaded file of attribute data is ~3gb "Tracts_Block_Groups_Only.zip" contains estimates for block groups and tracts only.

Now get the GEO files...

    $ wget "http://www2.census.gov/acs2011_5yr/summaryfile/2007-2011_ACSSF_All_In_2_Giant_Files(Experienced-Users-Only)/2011_ACS_Geography_Files.zip"
    $ unzip 2011_ACS_Geography_Files.zip
    $ mv geog GEO

The downloaded GEO files contain the link between the `Logical Record Number` of the attribute data and the `geoid` of the shapefile/geometry data

See a description of the files in `$ ls /pyacs` here: https://github.com/schmidtc/ACS_Tools/wiki/_preview

See ACS ethnic codes here: http://www.census.gov/acs/www/Downloads/data_documentation/CodeLists/2011_ACS_Code_Lists.pdf
  
See ACS description of variables: http://www.census.gov/acs/www/Downloads/data_documentation/SubjectDefinitions/2011_ACSSubjectDefinitions.pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.