Commit 4313845c authored by Manas Gabani's avatar Manas Gabani

markers added for teachers by educational qualification and numerical value visualization of KPIs

parent ad49ba07
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="containercards"> <div class="containercards">
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(classrooms_summary['total']) %}</h1> <h2>{% print(classrooms_summary['total']) %}</h2>
<h3>Classrooms</h3> <h3>Classrooms</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(classrooms_summary['good']) %}</h1> <h2>{% print(classrooms_summary['good']) %}</h2>
<h3>Good Condition</h3> <h3>Good Condition</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(classrooms_summary['minor_repair']) %}</h1> <h2>{% print(classrooms_summary['minor_repair']) %}</h2>
<h3>Need Minor Repair</h3> <h3>Need Minor Repair</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(classrooms_summary['major_repair']) %}</h1> <h2>{% print(classrooms_summary['major_repair']) %}</h2>
<h3>Need Major Repair</h3> <h3>Need Major Repair</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="containercards"> <div class="containercards">
<!-- <div class="card"> <!-- <div class="card">
<div class="box"> <div class="box">
<h1>{% print(facilities_summary['enrolment_lt_50']) %}</h1> <h2>{% print(facilities_summary['enrolment_lt_50']) %}</h2>
<h3>Enrolment &lt;= 50</h3> <h3>Enrolment &lt;= 50</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> --> </div> -->
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(facilities_summary['drinking_water']) %}</h1> <h2>{% print(facilities_summary['drinking_water']) %}</h2>
<h3>Schools with Drinking Water</h3> <h3>Schools with Drinking Water</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(facilities_summary['girls_toilet']) %}</h1> <h2>{% print(facilities_summary['girls_toilet']) %}</h2>
<h3>Schools with Girls' Toilet</h3> <h3>Schools with Girls' Toilet</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<!-- <div class="card"> <!-- <div class="card">
<div class="box"> <div class="box">
<h1>{% print(facilities_summary['ramp']) %}</h1> <h2>{% print(facilities_summary['ramp']) %}</h2>
<h3>Schools with Ramp</h3> <h3>Schools with Ramp</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</div> --> </div> -->
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(facilities_summary['single_classroom']) %}</h1> <h2>{% print(facilities_summary['single_classroom']) %}</h2>
<h3>Single Classroom Schools</h3> <h3>Single Classroom Schools</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(facilities_summary['single_teacher']) %}</h1> <h2>{% print(facilities_summary['single_teacher']) %}</h2>
<h3>Single Teacher Schools</h3> <h3>Single Teacher Schools</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="containercards"> <div class="containercards">
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(index_summary['students']) %}</h1> <h2>{% print(index_summary['students']) %}</h2>
<h3>Students</h3> <h3>Students</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(index_summary['teachers']) %}</h1> <h2>{% print(index_summary['teachers']) %}</h2>
<h3>Teachers</h3> <h3>Teachers</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(index_summary['schools']) %}</h1> <h2>{% print(index_summary['schools']) %}</h2>
<h3>Schools</h3> <h3>Schools</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(index_summary['classrooms']) %}</h1> <h2>{% print(index_summary['classrooms']) %}</h2>
<h3>Classrooms</h3> <h3>Classrooms</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="containercards"> <div class="containercards">
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(schools_summary['total']) %}</h1> <h2>{% print(schools_summary['total']) %}</h2>
<h3>Schools</h3> <h3>Schools</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(schools_summary['govt']) %}</h1> <h2>{% print(schools_summary['govt']) %}</h2>
<h3>Government</h3> <h3>Government</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(schools_summary['private']) %}</h1> <h2>{% print(schools_summary['private']) %}</h2>
<h3>Private</h3> <h3>Private</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(schools_summary['others']) %}</h1> <h2>{% print(schools_summary['others']) %}</h2>
<h3>Others</h3> <h3>Others</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="containercards"> <div class="containercards">
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(students_summary['total']) %}</h1> <h2>{% print(students_summary['total']) %}</h2>
<h3>Students</h3> <h3>Students</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(students_summary['govt']) %}</h1> <h2>{% print(students_summary['govt']) %}</h2>
<h3>Government</h3> <h3>Government</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(students_summary['private']) %}</h1> <h2>{% print(students_summary['private']) %}</h2>
<h3>Private</h3> <h3>Private</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(students_summary['others']) %}</h1> <h2>{% print(students_summary['others']) %}</h2>
<h3>Others</h3> <h3>Others</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="containercards"> <div class="containercards">
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(teachers_summary['total']) %}</h1> <h2>{% print(teachers_summary['total']) %}</h2>
<h3>Teachers</h3> <h3>Teachers</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(teachers_summary['govt']) %}</h1> <h2>{% print(teachers_summary['govt']) %}</h2>
<h3>Government</h3> <h3>Government</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(teachers_summary['private']) %}</h1> <h2>{% print(teachers_summary['private']) %}</h2>
<h3>Private</h3> <h3>Private</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<div class="card"> <div class="card">
<div class="box"> <div class="box">
<h1>{% print(teachers_summary['others']) %}</h1> <h2>{% print(teachers_summary['others']) %}</h2>
<h3>Others</h3> <h3>Others</h3>
</div> </div>
<div class="icon-case"> <div class="icon-case">
......
...@@ -5,7 +5,7 @@ import glob ...@@ -5,7 +5,7 @@ import glob
import matplotlib import matplotlib
matplotlib.use('Agg') matplotlib.use('Agg')
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from babel.numbers import format_number
# dict_summary={"top3":[],"bottom3":[]} # dict_summary={"top3":[],"bottom3":[]}
fig_size_ds_w, fig_size_ds_h = 10, 6 fig_size_ds_w, fig_size_ds_h = 10, 6
...@@ -50,7 +50,7 @@ def statewise_distribution(output_filename, input_df, year, ylabel, main_dimensi ...@@ -50,7 +50,7 @@ def statewise_distribution(output_filename, input_df, year, ylabel, main_dimensi
else: else:
dim = 'Category' dim = 'Category'
label='Year: ' + str(year) + ', ' + dim + ': ' + sub_dimension label='Year: ' + str(year) + ', ' + dim + ': ' + sub_dimension
plt.title(label=label, loc="right", fontsize=10, fontstyle='italic') plt.title(label=label, fontweight='bold', fontsize=10, fontstyle='italic')
# plt.xticks(rotation=90, ha="right", fontsize=10) # plt.xticks(rotation=90, ha="right", fontsize=10)
plt.yticks(fontsize=7) plt.yticks(fontsize=7)
# plt.bar(df_sum['State_Name'],df_sum['total_by_population'], align='center') # plt.bar(df_sum['State_Name'],df_sum['total_by_population'], align='center')
...@@ -90,7 +90,7 @@ def total_enrolment_by_category(output_filename, input_df, main_dimension, state ...@@ -90,7 +90,7 @@ def total_enrolment_by_category(output_filename, input_df, main_dimension, state
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='b', rotation=15, fontsize=7, weight='bold') plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='b', rotation=15, fontsize=7, weight='bold')
plt.legend() plt.legend()
plt.title(label='State: ' + state_name + ', Type: ' + main_dimension, loc="right", fontsize=10, fontstyle='italic') plt.title(label='State: ' + state_name + ', Type: ' + main_dimension, fontweight='bold', fontsize=10, fontstyle='italic')
plt.xticks(np.arange(min_year, max_year+1, 1.0)) plt.xticks(np.arange(min_year, max_year+1, 1.0))
plt.ylabel(ylabel) plt.ylabel(ylabel)
plt.xlabel('Year') plt.xlabel('Year')
...@@ -128,15 +128,27 @@ def total_teachers_by_main_dimension(output_filename, input_df, main_dimension, ...@@ -128,15 +128,27 @@ def total_teachers_by_main_dimension(output_filename, input_df, main_dimension,
df_pg = df_sum.loc[(df_sum['Sub_Dimension'] == "Post Graduate")] df_pg = df_sum.loc[(df_sum['Sub_Dimension'] == "Post Graduate")]
df_phd = df_sum.loc[(df_sum['Sub_Dimension'] == "M.Phil / Ph.D")] df_phd = df_sum.loc[(df_sum['Sub_Dimension'] == "M.Phil / Ph.D")]
plt.plot(df_bel_sec['Year'],df_bel_sec['total'],color='r', label='Below Secondary') plt.plot(df_bel_sec['Year'],df_bel_sec['total'], marker='o', color='r', label='Below Secondary')
plt.plot(df_sec['Year'],df_sec['total'],color='g', label='Secondary') for x, y in zip(df_bel_sec['Year'],df_bel_sec['total']):
plt.plot(df_hs['Year'],df_hs['total'],color='b', label='Higher Secondary') plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='r', rotation=15, fontsize=7, weight='bold')
plt.plot(df_grad['Year'],df_grad['total'],color='y', label='Graduate') plt.plot(df_sec['Year'],df_sec['total'], marker='+', color='g', label='Secondary')
plt.plot(df_pg['Year'],df_pg['total'],color='c', label='Post Graduate') for x, y in zip(df_sec['Year'],df_sec['total']):
plt.plot(df_phd['Year'],df_phd['total'],color='m', label='M.Phil / Ph.D') plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='g', rotation=15, fontsize=7, weight='bold')
plt.plot(df_hs['Year'],df_hs['total'], marker='*', color='b', label='Higher Secondary')
for x, y in zip(df_hs['Year'],df_hs['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='b', rotation=15, fontsize=7, weight='bold')
plt.plot(df_grad['Year'],df_grad['total'], marker='d', color='y', label='Graduate')
for x, y in zip(df_grad['Year'],df_grad['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='y', rotation=15, fontsize=7, weight='bold')
plt.plot(df_pg['Year'],df_pg['total'], marker='s', color='c', label='Post Graduate')
for x, y in zip(df_pg['Year'],df_pg['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='c', rotation=15, fontsize=7, weight='bold')
plt.plot(df_phd['Year'],df_phd['total'], marker='x', color='m', label='M.Phil / Ph.D')
for x, y in zip(df_phd['Year'],df_phd['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='m', rotation=15, fontsize=7, weight='bold')
plt.legend() plt.legend()
plt.title(label='State: ' + state_name + ', Type: ' + main_dimension, loc="right", fontsize=10, fontstyle='italic') plt.title(label='State: ' + state_name + ', Type: ' + main_dimension, fontweight='bold', fontsize=10, fontstyle='italic')
plt.xticks(np.arange(min_year, max_year+1, 1.0)) plt.xticks(np.arange(min_year, max_year+1, 1.0))
plt.ylabel('Number of Teachers') plt.ylabel('Number of Teachers')
plt.xlabel('Year') plt.xlabel('Year')
...@@ -167,7 +179,7 @@ def total_classrooms_by_trend(output_filename, input_df, state_code): ...@@ -167,7 +179,7 @@ def total_classrooms_by_trend(output_filename, input_df, state_code):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='b', rotation=15, fontsize=7, weight='bold') plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='b', rotation=15, fontsize=7, weight='bold')
plt.legend() plt.legend()
plt.title(label='State: ' + state_name, loc="right", fontsize=10, fontstyle='italic') plt.title(label='State: ' + state_name, fontweight='bold', fontsize=10, fontstyle='italic')
plt.xticks(np.arange(min_year, max_year+1, 1.0)) plt.xticks(np.arange(min_year, max_year+1, 1.0))
plt.ylabel('Number of Classrooms') plt.ylabel('Number of Classrooms')
plt.xlabel('Year') plt.xlabel('Year')
...@@ -210,7 +222,7 @@ def total_schools_for_facilities(output_filename, input_df, state_code): ...@@ -210,7 +222,7 @@ def total_schools_for_facilities(output_filename, input_df, state_code):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='m', rotation=15, fontsize=7, weight='bold') plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='m', rotation=15, fontsize=7, weight='bold')
plt.legend() plt.legend()
plt.title(label='State: ' + state_name, loc="right", fontsize=10, fontstyle='italic') plt.title(label='State: ' + state_name, fontweight='bold', fontsize=10, fontstyle='italic')
plt.xticks(np.arange(min_year, max_year+1, 1.0)) plt.xticks(np.arange(min_year, max_year+1, 1.0))
plt.ylabel('Number of Schools') plt.ylabel('Number of Schools')
plt.xlabel('Year') plt.xlabel('Year')
...@@ -252,7 +264,7 @@ def main_dimension_overall(output_filename, input_df, main_dimension, ylabel): ...@@ -252,7 +264,7 @@ def main_dimension_overall(output_filename, input_df, main_dimension, ylabel):
plt.text(x = x, y = y, s = '{:.0f}'.format(y)) plt.text(x = x, y = y, s = '{:.0f}'.format(y))
plt.legend() plt.legend()
plt.title(label='KPI: ' + ylabel, loc="right", fontsize=10, fontstyle='italic') plt.title(label='KPI: ' + ylabel, fontweight='bold', fontsize=10, fontstyle='italic')
plt.xticks(np.arange(min_year, max_year+1, 1.0)) plt.xticks(np.arange(min_year, max_year+1, 1.0))
plt.ylabel(ylabel) plt.ylabel(ylabel)
plt.xlabel('Year') plt.xlabel('Year')
...@@ -293,7 +305,7 @@ def total_schools_for_facilities_overall(output_filename, input_df): ...@@ -293,7 +305,7 @@ def total_schools_for_facilities_overall(output_filename, input_df):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='m', rotation=15, fontsize=7, weight='bold') plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='m', rotation=15, fontsize=7, weight='bold')
plt.legend() plt.legend()
plt.title(label='KPI: Number of Schools', loc="right", fontsize=10, fontstyle='italic') plt.title(label='KPI: Number of Schools', fontweight='bold', fontsize=10, fontstyle='italic')
plt.xticks(np.arange(min_year, max_year+1, 1.0)) plt.xticks(np.arange(min_year, max_year+1, 1.0))
plt.ylabel('Number of Schools') plt.ylabel('Number of Schools')
plt.xlabel('Year') plt.xlabel('Year')
...@@ -307,10 +319,10 @@ def get_index_summary(input_df): ...@@ -307,10 +319,10 @@ def get_index_summary(input_df):
schools = sum(input_df[(input_df['Main_Dimension']=='School by Category') & (input_df['Year']==latest_year)]['total']) schools = sum(input_df[(input_df['Main_Dimension']=='School by Category') & (input_df['Year']==latest_year)]['total'])
classrooms = sum(input_df[(input_df['Main_Dimension']=='Total Classrooms') & (input_df['Year']==latest_year)]['total']) classrooms = sum(input_df[(input_df['Main_Dimension']=='Total Classrooms') & (input_df['Year']==latest_year)]['total'])
return { return {
'students': int(students), 'students': format_number(int(students), locale='en_IN'),
'teachers': int(teachers), 'teachers': format_number(int(teachers), locale='en_IN'),
'schools': int(schools), 'schools': format_number(int(schools), locale='en_IN'),
'classrooms': int(classrooms) 'classrooms': format_number(int(classrooms), locale='en_IN')
} }
def get_dimension_wise_summary(input_df, state_code, main_dimension): def get_dimension_wise_summary(input_df, state_code, main_dimension):
...@@ -322,20 +334,20 @@ def get_dimension_wise_summary(input_df, state_code, main_dimension): ...@@ -322,20 +334,20 @@ def get_dimension_wise_summary(input_df, state_code, main_dimension):
private = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Private')]['total']) private = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Private')]['total'])
others = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Madrasas & Unrecognised')]['total']) others = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Madrasas & Unrecognised')]['total'])
return { return {
'total': int(total), 'total': format_number(int(total), locale='en_IN'),
'govt': int(govt), 'govt': format_number(int(govt), locale='en_IN'),
'private': int(private), 'private': format_number(int(private), locale='en_IN'),
'others': int(others) 'others': format_number(int(others), locale='en_IN')
} }
elif main_dimension=='Total Classrooms': elif main_dimension=='Total Classrooms':
good = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Good Condition')]['total']) good = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Good Condition')]['total'])
minor_repair = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Need Minor Repair')]['total']) minor_repair = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Need Minor Repair')]['total'])
major_repair = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Need Major Repair')]['total']) major_repair = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Need Major Repair')]['total'])
return { return {
'total': int(total), 'total': format_number(int(total), locale='en_IN'),
'good': int(good), 'good': format_number(int(good), locale='en_IN'),
'minor_repair': int(minor_repair), 'minor_repair': format_number(int(minor_repair), locale='en_IN'),
'major_repair': int(major_repair) 'major_repair': format_number(int(major_repair), locale='en_IN')
} }
else: else:
enrolment_lt_50 = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Enrolment <= 50')]['total']) enrolment_lt_50 = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Enrolment <= 50')]['total'])
...@@ -345,10 +357,10 @@ def get_dimension_wise_summary(input_df, state_code, main_dimension): ...@@ -345,10 +357,10 @@ def get_dimension_wise_summary(input_df, state_code, main_dimension):
single_classroom = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Single Classroom Schools')]['total']) single_classroom = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Single Classroom Schools')]['total'])
single_teacher = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Single Teacher Schools')]['total']) single_teacher = sum(df_fil[(df_fil['Main_Dimension']==main_dimension) & (df_fil['Sub_Dimension']=='Single Teacher Schools')]['total'])
return { return {
'enrolment_lt_50': int(enrolment_lt_50), 'enrolment_lt_50': format_number(int(enrolment_lt_50), locale='en_IN'),
'drinking_water': int(drinking_water), 'drinking_water': format_number(int(drinking_water), locale='en_IN'),
'girls_toilet': int(girls_toilet), 'girls_toilet': format_number(int(girls_toilet), locale='en_IN'),
'ramp': int(ramp), 'ramp': format_number(int(ramp), locale='en_IN'),
'single_classroom': int(single_classroom), 'single_classroom': format_number(int(single_classroom), locale='en_IN'),
'single_teacher': int(single_teacher) 'single_teacher': format_number(int(single_teacher), locale='en_IN')
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment