Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
comp20008-project-2
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Samantha Garrick
comp20008-project-2
Commits
a2ca594f
Commit
a2ca594f
authored
4 years ago
by
Oliver
Browse files
Options
Downloads
Patches
Plain Diff
LGA health conditions: smoker, preobese, obesity and heart disease
parent
5f3f0ba5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
LGA_by_HEALTH.csv
+9
-0
9 additions, 0 deletions
LGA_by_HEALTH.csv
LGA_by_HEALTH.py
+13
-0
13 additions, 0 deletions
LGA_by_HEALTH.py
SA2_to_LGA.py
+1
-1
1 addition, 1 deletion
SA2_to_LGA.py
with
23 additions
and
1 deletion
LGA_by_HEALTH.csv
0 → 100644
+
9
−
0
View file @
a2ca594f
LGA_CODE_2011,smokers,heart_disease,pre_obese,obese
21890,12.1,6.6,30.1,19.3
22670,14.5,9.1,28.1,16.8
22750,12.2,7.9,32.5,16.6
23110,11.8,8.1,30.4,21.3
23810,24.4,5.6,36.6,22.0
24330,15.7,3.9,34.9,11.9
27350,14.3,7.0,23.5,12.1
27450,8.9,6.7,33.1,16.4
This diff is collapsed.
Click to expand it.
LGA_by_HEALTH.py
0 → 100644
+
13
−
0
View file @
a2ca594f
import
pandas
as
pandas
df
=
pandas
.
read_csv
(
"
datasets/2015_LGA_health_profiles.csv
"
,
dtype
=
"
string
"
)
lgas
=
set
(
pandas
.
read_csv
(
"
PM10_to_LGA.csv
"
,
dtype
=
"
string
"
)[
"
LGA_CODE_2011
"
].
unique
())
df
=
df
[
df
[
"
lga_code
"
].
isin
(
lgas
)]
df
=
df
.
rename
(
columns
=
{
"
lga_code
"
:
"
LGA_CODE_2011
"
,
"
ppl_reporting_heart_disease_perc
"
:
"
heart_disease
"
,
"
ppl_reporting_being_pre_obese_perc
"
:
"
pre_obese
"
,
"
ppl_reporting_being_obese_perc
"
:
"
obese
"
,
"
ppl_aged_over_18_who_are_current_smokers_perc
"
:
"
smokers
"
})
df
=
df
.
sort_values
([
"
LGA_CODE_2011
"
])
df
=
df
.
reindex
(
columns
=
[
"
LGA_CODE_2011
"
,
"
smokers
"
,
"
heart_disease
"
,
"
pre_obese
"
,
"
obese
"
])
df
.
to_csv
(
path_or_buf
=
"
LGA_by_HEALTH.csv
"
,
index
=
False
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
SA2_to_LGA.py
+
1
−
1
View file @
a2ca594f
...
@@ -5,7 +5,7 @@ df = pandas.read_csv("datasets/2011_SA2_to_LGA_vic.csv", dtype = "string")
...
@@ -5,7 +5,7 @@ df = pandas.read_csv("datasets/2011_SA2_to_LGA_vic.csv", dtype = "string")
# Keep only Victorian LGAs
# Keep only Victorian LGAs
#df = df[df["LGA_CODE_2011"].str[0] == "2"]
#df = df[df["LGA_CODE_2011"].str[0] == "2"]
# Only ones in AQ_to_LGA.csv
# Only ones in AQ_to_LGA.csv
lgas
=
set
(
pandas
.
read_csv
(
"
AQ
_to_LGA.csv
"
,
dtype
=
"
string
"
)[
"
LGA_CODE_2011
"
].
unique
())
lgas
=
set
(
pandas
.
read_csv
(
"
PM10
_to_LGA.csv
"
,
dtype
=
"
string
"
)[
"
LGA_CODE_2011
"
].
unique
())
print
(
lgas
)
print
(
lgas
)
df
=
df
[
df
[
"
LGA_CODE_2011
"
].
isin
(
lgas
)]
df
=
df
[
df
[
"
LGA_CODE_2011
"
].
isin
(
lgas
)]
...
...
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