Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sas-en-test
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edward Samlafo-Adams
sas-en-test
Commits
d994fa17
Commit
d994fa17
authored
2 months ago
by
Edward Mawuko Samlafo-Adams
Browse files
Options
Downloads
Patches
Plain Diff
visualization improvements
parent
91879c97
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app_pages/__pycache__/visualization.cpython-310.pyc
+0
-0
0 additions, 0 deletions
app_pages/__pycache__/visualization.cpython-310.pyc
app_pages/visualization.py
+24
-22
24 additions, 22 deletions
app_pages/visualization.py
with
24 additions
and
22 deletions
app_pages/__pycache__/visualization.cpython-310.pyc
+
0
−
0
View file @
d994fa17
No preview for this file type
This diff is collapsed.
Click to expand it.
app_pages/visualization.py
+
24
−
22
View file @
d994fa17
...
...
@@ -20,7 +20,7 @@ def app():
# Sidebar navigation for graph selection
graph_choice
=
st
.
sidebar
.
radio
(
"
Select a Graph to Display:
"
,
(
"
Job Categories Distribution
"
,
"
Contract Types Distribution
"
,
"
Salary Distribution
"
)
(
"
Job Categories Distribution
"
,
"
Location vs Job Count
"
,
"
Salary Distribution
"
)
)
# Job Categories Bar Chart
...
...
@@ -30,7 +30,7 @@ def app():
category_counts
=
df
[
"
Category
"
].
value_counts
().
head
(
10
).
reset_index
()
category_counts
.
columns
=
[
"
Category
"
,
"
Count
"
]
plt
.
figure
(
figsize
=
(
10
,
6
))
sns
.
barplot
(
data
=
category_counts
,
y
=
"
Category
"
,
x
=
"
Count
"
,
hue
=
"
Category
"
,
dodge
=
False
,
palette
=
"
viridis
"
,
legend
=
False
)
sns
.
barplot
(
data
=
category_counts
,
y
=
"
Category
"
,
x
=
"
Count
"
,
palette
=
"
viridis
"
)
plt
.
title
(
"
Top 10 Job Categories
"
)
plt
.
xlabel
(
"
Number of Jobs
"
)
plt
.
ylabel
(
"
Category
"
)
...
...
@@ -38,30 +38,32 @@ def app():
else
:
st
.
warning
(
"
No
'
Category
'
column found in the dataset.
"
)
#
Contract Types
Bar Chart
elif
graph_choice
==
"
Contract Types Distribution
"
:
st
.
subheader
(
"
Contract Types Distribution
"
)
if
"
Primary Contract Type
"
in
df
.
columns
:
contract
_counts
=
df
[
"
Primary Contract Type
"
].
value_counts
().
reset_index
()
contract
_counts
.
columns
=
[
"
Contract Type
"
,
"
Count
"
]
plt
.
figure
(
figsize
=
(
8
,
5
))
sns
.
barplot
(
data
=
contract
_counts
,
x
=
"
Contract Type
"
,
y
=
"
Count
"
,
hue
=
"
Cont
ract Type
"
,
dodge
=
False
,
palette
=
"
crest
"
,
legend
=
False
)
plt
.
title
(
"
Contract Types Distribution
"
)
plt
.
xlabel
(
"
Contract Type
"
)
plt
.
ylabel
(
"
Number of Jobs
"
)
#
Location vs Job Count
Bar Chart
elif
graph_choice
==
"
Location vs Job Count
"
:
st
.
subheader
(
"
Top Locations by Job Count
"
)
if
"
Location
"
in
df
.
columns
:
location
_counts
=
df
[
"
Location
"
].
value_counts
().
head
(
10
).
reset_index
()
location
_counts
.
columns
=
[
"
Location
"
,
"
Count
"
]
plt
.
figure
(
figsize
=
(
10
,
6
))
sns
.
barplot
(
data
=
location
_counts
,
y
=
"
Location
"
,
x
=
"
Co
u
nt
"
,
palette
=
"
crest
"
)
plt
.
title
(
"
Top 10 Locations by Job Count
"
)
plt
.
xlabel
(
"
Number of Jobs
"
)
plt
.
ylabel
(
"
Location
"
)
st
.
pyplot
(
plt
)
else
:
st
.
warning
(
"
No
contract types data available
.
"
)
st
.
warning
(
"
No
'
Location
'
column found in the dataset
.
"
)
# Salary
Histogram
# Salary
Scatter Plot
elif
graph_choice
==
"
Salary Distribution
"
:
st
.
subheader
(
"
Salary
Distribution
"
)
st
.
subheader
(
"
Salary
Scatter Plot
"
)
if
"
Salary (Numeric)
"
in
df
.
columns
:
plt
.
figure
(
figsize
=
(
8
,
5
))
sns
.
histplot
(
df
[
"
Salary (Numeric)
"
].
dropna
(),
bins
=
30
,
color
=
'
skyblue
'
)
plt
.
title
(
"
Distribution of Salary
"
)
plt
.
xlabel
(
"
Salary (EUR)
"
)
plt
.
ylabel
(
"
Frequency
"
)
filtered_df
=
df
.
dropna
(
subset
=
[
"
Salary (Numeric)
"
])
filtered_df
=
filtered_df
.
reset_index
()
plt
.
figure
(
figsize
=
(
10
,
6
))
sns
.
scatterplot
(
data
=
filtered_df
,
x
=
"
index
"
,
y
=
"
Salary (Numeric)
"
,
alpha
=
0.7
,
color
=
"
blue
"
)
plt
.
title
(
"
Salary Distribution Across Job Index
"
)
plt
.
xlabel
(
"
Job Index
"
)
plt
.
ylabel
(
"
Salary (EUR)
"
)
st
.
pyplot
(
plt
)
else
:
st
.
warning
(
"
No
numerical salary data available
.
"
)
st
.
warning
(
"
No
'
Salary (Numeric)
'
column found in the dataset
.
"
)
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