Skip to main content
100%

Parse socioeconmic_data_states_2019-2010.csv

✓ Published0🌍 Public
PPeter Cordone
Last edited Sep 29, 2021
Created on Sep 7, 2021

This example parses a US Census socioeconomic dataset covering states from 2010 to 2019, displaying basic file statistics such as size in kilobytes, row count, and column count. It shows how to load and inspect a CSV file using `d3.csv`, then formats the results into a text message rendered in a large `<pre>` element. The code also includes commented alternatives using `fetch` with `async`/`await` and `d3.csvParse` for comparison. The data source is a remote CSV file hosted on GitHub Gist, containing quantitative census attributes like employment, occupation, industry, and poverty rates.

AI-generated description

What is the correlation between occupation, industry and people who live below the poverty level? What does that correlation look like by state?

Attributes that are interesting are: I extracted this data from the US Census web site (thanks to the book F. Donnelly, Exploring the U.S. census: your guide to America’s data. Los Angeles: SAGE, 2020). I've been wanting to learn to navigate the US Census data and web site (no small task) and this assignment gave the reason to do so!

There is quite a bit of data in the census extracts and I paired it down

  • Year is a categorical attribute and the year for the row
  • id is the census geoid for the state and is categorical
  • the rest of the attributes are quantitative. The columns quantify the population count of the state that for the columns category. The main areas are EMPLOYMENT STATUS, OCCUPATION, INDUSTRY and INCOME AND BENEFITS and the column header contains the corresponding text. The suffix text describes the category the count is for. The two columns at the end are the percentage of families below the poverty line.

Socioeconomic data extract from US Census 2019-2010 American Community Survey

MIT Licensed

Similar vizzes