Commit 230ef93b authored by Manas Gabani's avatar Manas Gabani

removal of two facilities for cleaner trend facilities graph

parent da4ee7fb
......@@ -149,8 +149,8 @@ school_facility = ''
@app.route('/facilities.html')
def facilities():
global facilities_summary, trend_school_facilities, distribution_school_facility, school_facility_summary, school_facility
school_facility = 'Enrolment <= 50'
distribution_school_facility = "img/distribution_school_facility_enrolment_lt_50_{}.jpeg".format(latest_year)
school_facility = 'Schools with Drinking Water'
distribution_school_facility = "img/distribution_school_facility_drinking_water_{}.jpeg".format(latest_year)
school_facility_summary = statewise_distribution(os.path.join(app.config['UPLOAD_FOLDER'], distribution_school_facility), final_df, latest_year, ylabel="Number of Schools / Population", main_dimension = "School Facilities", sub_dimension=school_facility)
trend_school_facilities = "img/trend_school_facilities_{}.jpeg".format(default_state_code)
total_schools_for_facilities(os.path.join(app.config['UPLOAD_FOLDER'], trend_school_facilities), final_df, default_state_code)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -165,10 +165,10 @@
</select>
Select Dimension:
<select name="facility" class="facility">
<option value="enrolment_lt_50">Enrolment &lt;= 50</option>
<!-- <option value="enrolment_lt_50">Enrolment &lt;= 50</option> -->
<option value="drinking_water">Schools with Drinking Water</option>
<option value="girls_toilet">Schools with Girls' Toilet</option>
<option value="ramp">Schools with Ramp</option>
<!-- <option value="ramp">Schools with Ramp</option> -->
<option value="single_classroom">Single Classroom Schools</option>
<option value="single_teacher">Single Teacher Schools</option>
</select>
......
......@@ -183,25 +183,25 @@ def total_schools_for_facilities(output_filename, input_df, state_code):
df_sum = df_fil.groupby(['Sub_Dimension','State_Code','Year'],as_index = False).sum()
df_sum = df_sum[['Sub_Dimension','State_Code','Year','total']]
df_enrolment_lt_50 = df_sum.loc[(df_sum['Sub_Dimension'] == "Enrolment <= 50")]
# df_enrolment_lt_50 = df_sum.loc[(df_sum['Sub_Dimension'] == "Enrolment <= 50")]
df_drinking_water = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Drinking Water")]
df_girls_toilet = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Girls' Toilet")]
df_ramp = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Ramp")]
# df_ramp = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Ramp")]
df_single_classroom = df_sum.loc[(df_sum['Sub_Dimension'] == "Single Classroom Schools")]
df_single_teacher = df_sum.loc[(df_sum['Sub_Dimension'] == "Single Teacher Schools")]
plt.plot(df_enrolment_lt_50['Year'], df_enrolment_lt_50['total'], marker='o', color='r', label='Enrolment <= 50')
for x, y in zip(df_enrolment_lt_50['Year'],df_enrolment_lt_50['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='r', rotation=15, fontsize=7, weight='bold')
# plt.plot(df_enrolment_lt_50['Year'], df_enrolment_lt_50['total'], marker='o', color='r', label='Enrolment <= 50')
# for x, y in zip(df_enrolment_lt_50['Year'],df_enrolment_lt_50['total']):
# plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='r', rotation=15, fontsize=7, weight='bold')
plt.plot(df_drinking_water['Year'], df_drinking_water['total'], marker='+', color='g', label='Schools with Drinking Water')
for x, y in zip(df_drinking_water['Year'],df_drinking_water['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='g', rotation=15, fontsize=7, weight='bold')
plt.plot(df_girls_toilet['Year'], df_girls_toilet['total'], marker='*', color='b', label='Schools with Girls\' Toilet')
for x, y in zip(df_girls_toilet['Year'],df_girls_toilet['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='b', rotation=15, fontsize=7, weight='bold')
plt.plot(df_ramp['Year'], df_ramp['total'], marker='d', color='y', label='Schools with Ramp')
for x, y in zip(df_ramp['Year'],df_ramp['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='y', rotation=15, fontsize=7, weight='bold')
# plt.plot(df_ramp['Year'], df_ramp['total'], marker='d', color='y', label='Schools with Ramp')
# for x, y in zip(df_ramp['Year'],df_ramp['total']):
# plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='y', rotation=15, fontsize=7, weight='bold')
plt.plot(df_single_classroom['Year'], df_single_classroom['total'], marker='s', color='c', label='Single Classroom Schools')
for x, y in zip(df_single_classroom['Year'],df_single_classroom['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='c', rotation=15, fontsize=7, weight='bold')
......@@ -266,25 +266,25 @@ def total_schools_for_facilities_overall(output_filename, input_df):
df_sum = df_fil.groupby(['Sub_Dimension','Year'],as_index = False).sum()
df_sum = df_sum[['Sub_Dimension','Year','total']]
df_enrolment_lt_50 = df_sum.loc[(df_sum['Sub_Dimension'] == "Enrolment <= 50")]
# df_enrolment_lt_50 = df_sum.loc[(df_sum['Sub_Dimension'] == "Enrolment <= 50")]
df_drinking_water = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Drinking Water")]
df_girls_toilet = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Girls' Toilet")]
df_ramp = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Ramp")]
# df_ramp = df_sum.loc[(df_sum['Sub_Dimension'] == "Schools with Ramp")]
df_single_classroom = df_sum.loc[(df_sum['Sub_Dimension'] == "Single Classroom Schools")]
df_single_teacher = df_sum.loc[(df_sum['Sub_Dimension'] == "Single Teacher Schools")]
plt.plot(df_enrolment_lt_50['Year'], df_enrolment_lt_50['total'], marker='o', color='r', label='Enrolment <= 50')
for x, y in zip(df_enrolment_lt_50['Year'],df_enrolment_lt_50['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='r', rotation=15, fontsize=7, weight='bold')
# plt.plot(df_enrolment_lt_50['Year'], df_enrolment_lt_50['total'], marker='o', color='r', label='Enrolment <= 50')
# for x, y in zip(df_enrolment_lt_50['Year'],df_enrolment_lt_50['total']):
# plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='r', rotation=15, fontsize=7, weight='bold')
plt.plot(df_drinking_water['Year'], df_drinking_water['total'], marker='+', color='g', label='Schools with Drinking Water')
for x, y in zip(df_drinking_water['Year'],df_drinking_water['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='g', rotation=15, fontsize=7, weight='bold')
plt.plot(df_girls_toilet['Year'], df_girls_toilet['total'], marker='*', color='b', label='Schools with Girls\' Toilet')
for x, y in zip(df_girls_toilet['Year'],df_girls_toilet['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='b', rotation=15, fontsize=7, weight='bold')
plt.plot(df_ramp['Year'], df_ramp['total'], marker='d', color='y', label='Schools with Ramp')
for x, y in zip(df_ramp['Year'],df_ramp['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='y', rotation=15, fontsize=7, weight='bold')
# plt.plot(df_ramp['Year'], df_ramp['total'], marker='d', color='y', label='Schools with Ramp')
# for x, y in zip(df_ramp['Year'],df_ramp['total']):
# plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='y', rotation=15, fontsize=7, weight='bold')
plt.plot(df_single_classroom['Year'], df_single_classroom['total'], marker='s', color='c', label='Single Classroom Schools')
for x, y in zip(df_single_classroom['Year'],df_single_classroom['total']):
plt.text(x = x, y = y, s = '{:.0f}'.format(y), color='c', rotation=15, fontsize=7, weight='bold')
......
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