Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education in INDIA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Manas
Education in INDIA
Commits
a327daeb
Commit
a327daeb
authored
Nov 22, 2022
by
Manas Gabani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
top3 and bottom3 issue resolved
parent
b262e3c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
config.py
config.py
+0
-1
utils.py
utils.py
+10
-5
No files found.
config.py
View file @
a327daeb
dict_summary
=
{
"top3"
:[],
"bottom3"
:[]}
form_value_to_sub_dimension_mapping
=
{
'govt'
:
'Government'
,
'private'
:
'Private'
,
...
...
utils.py
View file @
a327daeb
...
...
@@ -6,8 +6,8 @@ import matplotlib
matplotlib
.
use
(
'Agg'
)
import
matplotlib.pyplot
as
plt
dict_summary
=
{
"top3"
:[],
"bottom3"
:[]}
fig_size_ds_w
,
fig_size_ds_h
=
8
,
6
#
dict_summary={"top3":[],"bottom3":[]}
fig_size_ds_w
,
fig_size_ds_h
=
10
,
6
fig_size_tr_w
,
fig_size_tr_h
=
8
,
6
def
read_all_csv
(
path
=
'./rawdata_csv/'
,
extension
=
'csv'
):
...
...
@@ -30,6 +30,7 @@ def read_all_csv(path='./rawdata_csv/', extension='csv'):
return
final_df
def
statewise_distribution
(
output_filename
,
input_df
,
year
,
ylabel
,
main_dimension
,
sub_dimension
=
''
):
dict_summary
=
{
"top3"
:[],
"bottom3"
:[]}
if
sub_dimension
:
df_filtered
=
input_df
.
loc
[(
input_df
[
'Main_Dimension'
]
==
main_dimension
)
&
((
input_df
[
'Sub_Dimension'
]
==
sub_dimension
))]
else
:
...
...
@@ -40,10 +41,14 @@ def statewise_distribution(output_filename, input_df, year, ylabel, main_dimensi
fig
=
plt
.
figure
(
figsize
=
(
fig_size_ds_w
,
fig_size_ds_h
))
plt
.
title
(
label
=
'KPI: '
+
ylabel
,
loc
=
"right"
,
fontsize
=
15
,
fontstyle
=
'italic'
)
plt
.
xticks
(
rotation
=
90
,
ha
=
"right"
,
fontsize
=
8
)
plt
.
bar
(
df_sum
[
'State_Name'
],
df_sum
[
'total_by_population'
],
align
=
'center'
)
# plt.xticks(rotation=90, ha="right", fontsize=8)
plt
.
yticks
(
fontsize
=
7
)
# plt.bar(df_sum['State_Name'],df_sum['total_by_population'], align='center')
plt
.
barh
(
df_sum
[
'State_Name'
],
df_sum
[
'total_by_population'
],
align
=
'center'
)
# plt.bar(df_sum['total_by_population'], label=df_sum['State_Name'], align='center')
# plt.ylabel('Enrollements/Population')
plt
.
ylabel
(
ylabel
)
plt
.
xlabel
(
ylabel
)
# plt.ylabel(ylabel)
list_states
=
list
(
df_sum
[
'State_Name'
])
dict_summary
[
'top3'
]
=
[
list_states
[
0
],
list_states
[
1
],
list_states
[
2
]]
dict_summary
[
'bottom3'
]
=
[
list_states
[
-
1
],
list_states
[
-
2
],
list_states
[
-
3
]]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment