This repo contains the code necessary to produce the data files in the repo at: https://codeberg.org/christopherphan/US_population_distribution
 
 
 
Go to file
Christopher Phan e75a61e616 Change fancy dash to a normal dash 2023-07-06 17:53:35 -05:00
raw_data Add initial files 2023-07-05 16:02:22 -05:00
source Obfuscate licence info in make_data_js.py 2023-07-06 17:40:39 -05:00
.gitignore Add program to make data.js 2023-07-05 17:39:17 -05:00
LICENSE.md Change fancy dash to a normal dash 2023-07-06 17:53:35 -05:00
README.md Add spdx id to README.md 2023-07-06 17:53:11 -05:00
build Add program to make data.js 2023-07-05 17:39:17 -05:00
clean Add clean script 2023-07-05 17:48:21 -05:00

README.md

Making the U.S. population treemap

This repo contains the code necessary to produce the files treemap.svg, treemap.pdf, and data.js in the repo at https://codeberg.org/christopherphan/US_population_distribution.

Preparing the CSV files

These are the steps used to obtain the CSV files in the raw_data directory.

raw_data/cbsa-est2022.csv

  1. Download https://www2.census.gov/programs-surveys/popest/datasets/2020-2022/metro/totals/cbsa-est2022.csv

raw_data/co-est2022-pop.csv

  1. Download https://www2.census.gov/programs-surveys/popest/tables/2020-2022/counties/totals/co-est2022-pop.xlsx

  2. Delete the first five rows and last five rows

  3. Insert the following as the first row

    County, 2020-04-01, 2020-07-01, 2021-07-01, 2022-07-01

  4. Export as CSV

raw_data/list1_2020.csv

  1. Download https://www2.census.gov/programs-surveys/metro-micro/geographies/reference-files/2020/delineation-files/list1_2020.xls

  2. Delete the first two rows and last four rows

  3. Export as CSV

Create the other files

  1. Run the shell script clean

  2. Run the shell script build

Sources