Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
ds_cs4bd_2324
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s90907
ds_cs4bd_2324
Commits
2f2df7b7
Commit
2f2df7b7
authored
1 year ago
by
Sven Graupner
Browse files
Options
Downloads
Patches
Plain Diff
update income_tax_analysis.py
parent
c4e27953
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
B_explore_python/income_tax_analysis.py
+6
-15
6 additions, 15 deletions
B_explore_python/income_tax_analysis.py
with
6 additions
and
15 deletions
B_explore_python/income_tax_analysis.py
+
6
−
15
View file @
2f2df7b7
...
...
@@ -3,7 +3,8 @@ Code for Assignment B: Explore Python
- Challenge 4: Income Analysis
- Challenge 5: Code Income Analysis
Based on 2020 tax returns, income distribution in Madera County, CA, ZIP 93636 was:
Based on 2020 tax returns, income distribution in Madera County, CA
with (postal) ZIP code 93636 was:
#
income brackets: number of tax returns
filed in brackets:
...
...
@@ -13,14 +14,6 @@ income brackets: number of tax returns
[$75,000 to under $100,000] 830
[$100,000 to under $200,000] 1,660
[$200,000 or more, up to $10M>] 550
Find more income distributions:
[93636](https://simplemaps.com/us-zips/93636) (Madera County, CA),
[94040](https://simplemaps.com/us-zips/94040) (Mountain View, CA),
[94304](https://simplemaps.com/us-zips/94304) (Palo Alto, CA),
[94027](https://simplemaps.com/us-zips/94027) (Atherton, CA),
[50860](https://simplemaps.com/us-zips/50860) (Redding, IA) and
[10023](https://simplemaps.com/us-zips/10023) (New York City, NY U West). (1 Pt)
'''
# design a data structure that stores information about a ZIP area
...
...
@@ -35,18 +28,17 @@ zip_10023 = None
# implement a function that calculates the mean income for a ZIP area
def
mean_income
(
_zip
)
->
int
:
return
25000
# mock result, replace with co
rrect
result
return
25000
# mock result, replace with co
mputed
result
# implement a function that calculates the median income for a ZIP area
def
median_income
(
_zip
)
->
int
:
return
18500
# mock result, replace with co
rrect
result
return
18500
# mock result, replace with co
mputed
result
# use function t
hat
print
s analysis
results for a ZIP area
# use
this
function t
o
print results for a ZIP area
def
print_analysis
(
_zip
):
_county
=
'
Madera, CA
'
# -> "mean_income in Redding, IA is: 33,333 - median_income is: 31,249"
print
(
f
'
mean_income in
{
_county
:
26
}
is:
{
mean_income
(
_zip
)
:
10
,
}
-
'
+
f
'
median_income is:
{
median_income
(
_zip
)
:
8
,
}
'
...
...
@@ -60,7 +52,6 @@ try:
mean_income
,
median_income
,
print_analysis
=
mod
.
mean_income
,
mod
.
median_income
,
mod
.
print_analysis
zip_93636
,
zip_94040
,
zip_94304
,
zip_94027
,
zip_50860
,
zip_10023
=
\
mod
.
zip_93636
,
mod
.
zip_94040
,
mod
.
zip_94304
,
mod
.
zip_94027
,
mod
.
zip_50860
,
mod
.
zip_10023
print
(
f
'
solution module found:
{
solution_module
}
.py
'
)
#
except
ImportError
:
pass
...
...
@@ -68,7 +59,7 @@ except ImportError:
if
__name__
==
'
__main__
'
:
'''
driver code that runs when
this
file is directly executed
driver code that runs when file is directly executed
'''
print_analysis
(
zip_93636
)
print_analysis
(
zip_94040
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment