Skip to content

Commit 3a61d44

Browse files
authored
Update analyze-us-census-data-with-scipy.mdx
1 parent 6bbff29 commit 3a61d44

File tree

1 file changed

+27
-35
lines changed

1 file changed

+27
-35
lines changed

projects/analyze-us-census-data-with-scipy/analyze-us-census-data-with-scipy.mdx

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Analyze U.S. Census Data with SciPy
33
author: Sade Snowden-Akintunde
44
uid: LC6iTrJZzITO0aBq3iaamSvy6Q93
5-
datePublished: 2025-01-02
5+
datePublished: 2025-01-13
66
published: true
77
description: Learn how to analyze U.S. census data with SciPy
88
header: https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/assets%2Findex%2F12423.png?alt=media&token=721aaaaa-f431-438e-bd19-c3f6a97afb41
@@ -33,9 +33,9 @@ tags:
3333
uid={true}
3434
/>
3535

36-
**Prerequisites**: Intermediate Python, SciPy
36+
**Prerequisites**: Python, NumPy, SciPy
3737
**Version**: Python 3
38-
**Read Time**: X minutes
38+
**Read Time**: 45 minutes
3939

4040
## Introduction
4141

@@ -48,7 +48,9 @@ In this project tutorial, we'll be analyzing a dataset gathered from the 2022 [U
4848
description="U.S. Census Data Analysis"
4949
/>
5050

51-
We will begin to test our assumptions and answer some basic questions about various demographic groups using SciPy, NumPy, Pandas, and some basic working knowledge of statistics, including the following:
51+
We will begin to test our assumptions and answer some basic questions about various demographic groups using SciPy, NumPy, Pandas, and some basic working knowledge of statistics.
52+
53+
The questions include:
5254

5355
- Is there a difference in mobility patterns between those that moved within their home state versus across states lines in New York and California in particular?
5456
- And do trends vary amongst citizenship status?
@@ -57,7 +59,7 @@ We will begin to test our assumptions and answer some basic questions about vari
5759

5860
## Cleaning Raw Data
5961

60-
As you can see below, the original data provided by census.gov contains two separate CSVs, one with the raw data and another with metadata that contains details of what each column represents.
62+
As you can see below, the original data provided by [census.gov](https://data.census.gov/) contains two separate CSVs, one with the raw data and another with metadata that contains details of what each column represents.
6163

6264
<RoundedImage
6365
link="https://i.imgur.com/uvbRfkQ.png"
@@ -88,45 +90,35 @@ For the categories listed, each dataset contains the following columns, which ar
8890

8991
### Geographical Data
9092

91-
- Geography ID: a unique identifier used to reference specific geographic areas
92-
- Census Tract: a small, relatively permanent subdivision of a county
93-
- State: the state in which the Census Tract is located
94-
- County: the county within the state in which the Census Tract resides
95-
- Region: the broader geographic area in which the state or county is located, typically referring to one of four major regions: Northeast, Midwest, South, or West
96-
- Division: a sub-region within a Census Bureau-defined region, used for more detailed geographic analysis
97-
- Total Population: the total number of people residing in a specific Census Tract
93+
- **Geography ID**: a unique identifier used to reference specific geographic areas
94+
- **Census Tract**: a small, relatively permanent subdivision of a county
95+
- **State**: the state in which the Census Tract is located
96+
- **County**: the county within the state in which the Census Tract resides
97+
- **Region**: the broader geographic area in which the state or county is located, typically referring to one of four major regions: Northeast, Midwest, South, or West
98+
- **Division**: a sub-region within a Census Bureau-defined region, used for more detailed geographic analysis
99+
- **Total Population**: the total number of people residing in a specific Census Tract
98100

99101
### Citizenship Status
100102

101-
Total U.S. Citizens (Native): the total number of individuals who are U.S. citizens by birth
102-
103-
Total U.S. Citizens (Naturalized): the total number of individuals who have obtained U.S. citizenship through the naturalization process after being born in another country
104-
105-
Total Non-Citizens: the total number of individuals who are not U.S. citizens, including both legal immigrants, visa holders, and undocumented individuals
103+
- **Total U.S. Citizens (Native)**: the total number of individuals who are U.S. citizens by birth
104+
- **Total U.S. Citizens (Naturalized)**: the total number of individuals who have obtained U.S. citizenship through the naturalization process after being born in another country
105+
- **Total Non-Citizens**: the total number of individuals who are not U.S. citizens, including both legal immigrants, visa holders, and undocumented individuals
106106

107107
### Marital Status
108108

109-
Married: the total number of individuals who are legally married at the time of the census
110-
111-
Never Married: the total number of individuals who have never been legally married
112-
113-
Separated: the total number of individuals who are legally married but currently living apart from their spouse due to marital separation
114-
115-
Divorced: the total number of individuals who have been legally divorced
116-
117-
Widowed: the total number of individuals who have lost their spouse and have not remarried
109+
- **Married:** the total number of individuals who are legally married at the time of the census
110+
- **Never Married:** the total number of individuals who have never been legally married
111+
- **Separated:** the total number of individuals who are legally married but currently living apart from their spouse due to marital separation
112+
- **Divorced:** the total number of individuals who have been legally divorced
113+
- **Widowed:** the total number of individuals who have lost their spouse and have not remarried
118114

119115
### Educational Attainment
120116

121-
Less than a High School Graduate: the total number of individuals who have not completed high school or its equivalent
122-
123-
High School Graduate (or its Equivalency): the total number of individuals who have completed high school or obtained an equivalent diploma, such as a GED
124-
125-
Some College or Associate's Degree: the total number of individuals who have attended college or earned an Associate's Degree but have not completed a Bachelor's Degree
126-
127-
Bachelor's Degree: the total number of individuals who have earned a Bachelor's Degree, typically after completing four years of undergraduate education at a university or college
128-
129-
Graduate or Professional Degree: the total number of individuals who have earned a Master's Degree, Doctoral Degree (Ph.D.), or other professional degrees such as a Law Degree (J.D.) or Medical Degree (M.D.)
117+
- **Less than a High School Graduate**: the total number of individuals who have not completed high school or its equivalent
118+
- **High School Graduate (or its Equivalency)**: the total number of individuals who have completed high school or obtained an equivalent diploma, such as a GED
119+
- **Some College or Associate's Degree**: the total number of individuals who have attended college or earned an Associate's Degree but have not completed a Bachelor's Degree
120+
- **Bachelor's Degree**: the total number of individuals who have earned a Bachelor's Degree, typically after completing four years of undergraduate education at a university or college
121+
- **Graduate or Professional Degree**: the total number of individuals who have earned a Master's Degree, Doctoral Degree (Ph.D.), or other professional degrees such as a Law Degree (J.D.) or Medical Degree (M.D.)
130122

131123
In this tutorial, we'll use SciPy to run some analysis and find out whether there are statistically significant differences in relocation patterns for each group - but first, let’s review the basics.
132124

0 commit comments

Comments
 (0)