-
Notifications
You must be signed in to change notification settings - Fork 0
education service delivery indicators #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yukinko-iwasaki
wants to merge
7
commits into
main
Choose a base branch
from
enhance/add_teacher_pupil_ratio
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+251
−3
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
13719a5
add the teacher pupil ratio
yukinko-iwasaki 3bd4659
Apply suggestions from code review
yukinko-iwasaki 3c9159c
add basic service data
yukinko-iwasaki 4bee34a
Apply suggestions from code review
yukinko-iwasaki c715cd7
add teacher's salary
yukinko-iwasaki 2b83f38
Merge branch 'enhance/add_teacher_pupil_ratio' of https://github.com/…
yukinko-iwasaki 34fc2a9
add completion rate
yukinko-iwasaki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Databricks notebook source | ||
| # MAGIC %run ../utils | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| # Completion rate by education level (UIS CR.MOD modeled series). Pulled directly | ||
| # from the UNESCO Institute for Statistics (UIS) API. Values are percentages (0-100). | ||
| # Levels: .1 = primary, .2 = lower secondary, .3 = upper secondary. | ||
| series_to_col_name = { | ||
| 'CR.MOD.1': 'completion_rate_primary', | ||
| 'CR.MOD.2': 'completion_rate_lower_secondary', | ||
| 'CR.MOD.3': 'completion_rate_upper_secondary', | ||
| } | ||
|
|
||
| data_source = 'UNESCO Institute for Statistics (UIS)' | ||
|
|
||
| # outer join so a country-year is kept even if it reports only some levels | ||
| df = uis_fetch(series_to_col_name, data_source, how='outer') | ||
| df | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| sdf = spark.createDataFrame(df) | ||
| sdf.write.mode("overwrite").option("overwriteSchema", "true").saveAsTable("prd_mega.indicator.completion_rates") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Databricks notebook source | ||
| # MAGIC %run ../utils | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| # Pupil-teacher ratio by education level (World Bank / UNESCO Institute for Statistics) | ||
| indicators = [ | ||
| 'SE.PRE.ENRL.TC.ZS', | ||
| 'SE.PRM.ENRL.TC.ZS', | ||
| 'SE.SEC.ENRL.TC.ZS', | ||
| 'SE.SEC.ENRL.LO.TC.ZS', | ||
| 'SE.SEC.ENRL.UP.TC.ZS', | ||
| 'SE.TER.ENRL.TC.ZS', | ||
| ] | ||
| col_names = [ | ||
| 'pupil_teacher_ratio_pre_primary', | ||
| 'pupil_teacher_ratio_primary', | ||
| 'pupil_teacher_ratio_secondary', | ||
| 'pupil_teacher_ratio_lower_secondary', | ||
| 'pupil_teacher_ratio_upper_secondary', | ||
| 'pupil_teacher_ratio_tertiary', | ||
| ] | ||
|
|
||
| data_source = 'UNESCO Institute for Statistics (UIS)' | ||
|
|
||
| # outer join so a country-year is kept even if it reports only some education levels | ||
| df = wbgapi_fetch(indicators, col_names, data_source, how='outer') | ||
| df | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| sdf = spark.createDataFrame(df) | ||
| sdf.write.mode("overwrite").option("overwriteSchema", "true").saveAsTable("prd_mega.indicator.pupil_teacher_ratio") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Databricks notebook source | ||
| # MAGIC %run ../utils | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| # Proportion of schools with access to basic services / infrastructure, by | ||
| # education level (UIS "school basic services", SDG 4.a.1). Pulled directly from | ||
| # the UNESCO Institute for Statistics (UIS) API. Values are percentages (0-100). | ||
| # Levels: .1 = primary, .2 = lower secondary, .3 = upper secondary. | ||
| series_to_col_name = { | ||
| 'SCHBSP.1.WELEC': 'schools_with_electricity_primary', | ||
| 'SCHBSP.2.WELEC': 'schools_with_electricity_lower_secondary', | ||
| 'SCHBSP.3.WELEC': 'schools_with_electricity_upper_secondary', | ||
| 'SCHBSP.1.WINTERN': 'schools_with_internet_primary', | ||
| 'SCHBSP.2.WINTERN': 'schools_with_internet_lower_secondary', | ||
| 'SCHBSP.3.WINTERN': 'schools_with_internet_upper_secondary', | ||
| 'SCHBSP.1.WCOMPUT': 'schools_with_computers_primary', | ||
| 'SCHBSP.2.WCOMPUT': 'schools_with_computers_lower_secondary', | ||
| 'SCHBSP.3.WCOMPUT': 'schools_with_computers_upper_secondary', | ||
| 'SCHBSP.1.WWATA': 'schools_with_basic_water_primary', | ||
| 'SCHBSP.2.WWATA': 'schools_with_basic_water_lower_secondary', | ||
| 'SCHBSP.3.WWATA': 'schools_with_basic_water_upper_secondary', | ||
| } | ||
|
|
||
| data_source = 'UNESCO Institute for Statistics (UIS)' | ||
|
|
||
| # outer join so a country-year is kept even if it reports only some indicators | ||
| df = uis_fetch(series_to_col_name, data_source, how='outer') | ||
| df | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| sdf = spark.createDataFrame(df) | ||
| sdf.write.mode("overwrite").option("overwriteSchema", "true").saveAsTable("prd_mega.indicator.school_basic_services") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Databricks notebook source | ||
| # MAGIC %run ../utils | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| # Teachers' salaries by education level (UIS TSALARY series). Pulled directly | ||
| # from the UNESCO Institute for Statistics (UIS) API. | ||
| # Levels: .0 = pre-primary, .1 = primary, .2 = lower secondary, .3 = upper secondary. | ||
| series_to_col_name = { | ||
| 'TSALARY.0': 'teacher_salary_pre_primary', | ||
| 'TSALARY.1': 'teacher_salary_primary', | ||
| 'TSALARY.2': 'teacher_salary_lower_secondary', | ||
| 'TSALARY.3': 'teacher_salary_upper_secondary', | ||
| } | ||
|
|
||
| data_source = 'UNESCO Institute for Statistics (UIS)' | ||
|
|
||
| # outer join so a country-year is kept even if it reports only some levels | ||
| df = uis_fetch(series_to_col_name, data_source, how='outer') | ||
| df | ||
|
|
||
| # COMMAND ---------- | ||
|
|
||
| sdf = spark.createDataFrame(df) | ||
| sdf.write.mode("overwrite").option("overwriteSchema", "true").saveAsTable("prd_mega.indicator.teacher_salaries") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.