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
### prerequisites | |
sudo yum groupinstall "Development Tools" | |
git --version | |
gcc --version | |
bash --version | |
python --version # (system) | |
sudo yum install -y openssl-devel readline-devel zlib-devel | |
sudo yum update | |
### install `pyenv` |
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
-- | |
-- GEOIP IN POSTGRESQL | |
-- | |
-- We use two approaches. First using PostgreSQL inet and cidr types and indexing (PostgreSQL 9.4 and later), | |
-- and then using ip4r (https://github.com/RhodiumToad/ip4r). | |
-- The performance of ip4r indexes is significantly better than PostgreSQL's own index. | |
-- An operation that took 42s using ip4r took 47 minutes using PostgreSQL's cidr index. | |
-- |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
For each year, parse the pdf manual, then use that information to | |
unpack the fixed-width data file. | |
Source data files can be found here: | |
https://www.cdc.gov/nchs/data_access/vitalstatsonline.htm#Mortality_Multiple | |
Passes basic tests for 2005-2015. Untested on earlier years. |