Python Analytics

Nafs Results Analytics — Aseer Region

A Python pipeline over official Nafs results for Aseer schools (1444–1447 AH): it checks the data against 15 quality rules, reconciles its results to the official department averages, derives the 1447 tested counts mathematically from the proficiency shares, then builds trends, gaps and school segments that feed this dashboard.

  1. 1Nafs data107,725 rows
  2. 2DQ rulesDQ-01…15
  3. 3Reconciliation48/48 match
  4. 4DashboardJSON → Chart.js
Filters

Proficiency trend vs national

Official national benchmark (published to 1446 AH), weighted by the selected grade/subject/gender mix

Key findings

Generated by the pipeline
  • Aseer proficiency rose from 31.5% (1444 AH) to 37.5% (1446 AH), +6.0 pts — reconciled to the official department averages.
  • 1447 AH proficiency is 32.54% (-4.97 pts vs 1446). The largest drop is Grade 9 Reading (-14.9 pts) and the largest gain Grade 6 Mathematics (+8.2).
  • Of the -4.97 pt change, -3.57 is real performance change within grade and subject and -1.40 is the shift in who was tested (grade 3 testers -3.8%, grade 6 -16.6% in the same schools). At the 1446 mix, 1447 would be 33.94%.
  • The gap to the national average is -3.1 pts in 1446 AH vs -3.1 in 1444 AH: the region improved at the national pace without closing the gap.
  • In 1447 AH the highest proficiency is Grade 6 Science (56.1%) and the lowest Grade 9 Mathematics (17.5%); the weakest sub-domain is Reading comprehension in Grade 3 Reading (21.0%).
  • In 1447 AH the top governorate is Al-Namas (43.6%) and the lowest Al-Birk (22.2%); most improved since 1446 is Tarib (+5.5).
  • Boys and girls converge at student level in 1447 AH (32.0% vs 32.9%) after girls led in 1444; at school level the difference is +0.3 pts (not statistically significant).
  • 224 schools flagged for priority intervention: ≥5 pts below the regional average and declining ≥5 pts more than the region (of 1,831 classified).

Proficiency by subject & grade

Performance-level distribution

Share of students per level · proficient = high + medium

Governorate ranking

Dashed line: regional average · governorates with fewer than 3 schools in the selection are hidden

Gender & authority

Sub-domain diagnosis

For the selected year, grade and subjectRegion level · red mark = whole-domain proficiency

School segmentation: level vs change

Each dot is a school · 1447 AH vs 1446 · change measured relative to the region (-5.0) · min. 15 students

Priority schools for intervention

≥5 pts below average, declining ≥5 pts more than the region · ≥25 students · school names withheld in the public version
SchoolGovernorate14461447Δ
P-01 · Girls Rijal Alma88.7%15.0%-73.7
P-02 · Boys Bisha84.4%23.9%-60.5
P-03 · Girls Muhayil45.7%6.8%-38.8
P-04 · Girls Ahad Rufaidah65.0%17.5%-47.5
P-05 · Girls Rijal Alma65.0%19.8%-45.2
P-06 · Girls Rijal Alma27.7%1.5%-26.2
P-07 · Girls Rijal Alma36.3%6.7%-29.6
P-08 · Girls Tathlith52.0%14.9%-37.1
P-09 · Girls Rijal Alma62.5%20.6%-41.9
P-10 · Girls Abha47.1%13.5%-33.5
P-11 · Girls Abha44.7%12.5%-32.2
P-12 · Girls Bisha73.3%26.9%-46.4

Total flagged: 224 · The named list is kept internally and not published

Data quality before analysis

15 rules and reconciliation to official figures

Before any calculation the Nafs data is checked against rules mapped to DAMA dimensions. The key check is reconciliation: the proficiency the pipeline computes from student counts matches the official department average for every grade, subject and gender.

107,725
Rows checked
2,308
Schools
48/48
Official matches
8
Rules passed
5
Remediated
2
Open with owner

Reconciliation to the official department average

YearGradeSubjectBoys: calc / officialGirls: calc / official
1446Grade 3Mathematics 50.7 / 50.7 ✓23.5 / 23.5 ✓
1446Grade 3Reading 41.3 / 41.3 ✓26.3 / 26.3 ✓
1446Grade 6Mathematics 38.1 / 38.1 ✓38.3 / 38.3 ✓
1446Grade 6Science 53.2 / 53.2 ✓61.6 / 61.6 ✓
1446Grade 6Reading 39.4 / 39.4 ✓50.1 / 50.1 ✓
1446Grade 9Mathematics 23.7 / 23.7 ✓24.5 / 24.5 ✓
1446Grade 9Science 39.2 / 39.1 ✓47.0 / 47.0 ✓
1446Grade 9Reading 31.7 / 31.7 ✓45.5 / 45.5 ✓
1446 AH shown; 1444 and 1445 also match (difference 0.0 in every case).
RuleDimensionCheckCheckedFailedStatusAction
DQ-01CompletenessMinisterial school number present 107,7250 PassQuarantine & return to source
DQ-02UniquenessOne row per year/school/grade/sub-domain 107,7250 PassRemove duplicates after review
DQ-03ValidityTested ≤ enrolled and proficient ≤ tested 77,0760 PassVerify against source file
DQ-04AccuracyPublished rate equals proficient ÷ tested 77,0760 PassRecompute from counts
DQ-05ConsistencyFour performance levels sum to 100% 77,0760 PassReview level distribution
DQ-06ReconciliationComputed proficiency matches the official department average (per grade, subject, gender) 480 PassInvestigate with data owner
DQ-07ConformityProficiency on a common 0–100 scale 30,64930,649 RemediatedConvert 1447 export from 0–1 fraction to %
DQ-08ComparabilityAverage-score scale stable across years 41 RemediatedDo not compare scores across years (≈500 in 1444–46 vs 0–100 in 1447); use proficiency
DQ-09CompletenessEducation office present on every row 77,07630,205 OpenUse governorate reference data; raise with data owner
DQ-10ConsistencyOffice label matches reference list 46,8711,328 RemediatedStandardise 7 short labels (e.g. 'Bariq' → 'Bariq Education Office')
DQ-11Master dataOne name per ministerial number across years 2,308313 RemediatedAdopt latest-year name as golden record
DQ-12Reference dataGovernorate known for every school 2,308145 OpenJoin on ministerial number; unmatched shown as 'Unmapped'
DQ-13CompletenessTested / proficient counts available 30,64930,649 RemediatedTested count rebuilt per school-grade from the denominators of its proficiency shares (LCM) — 2,962 school-grades, 1 without an informative share
DQ-14ReconciliationConsolidated 1447 file matches the earlier exports row by row 14,6710 PassAdopt the consolidated file as the primary source
DQ-15ConsistencyOne tested count per school-grade across all subjects and sub-domains (1444–1446) 7,3780 PassBasis for the 1447 count reconstruction
Method & statistics

Behind the numbers

Change 1446–1447 AH-4.97 pts performance -3.57 · tested mix -1.40
Private & intl. vs public+4.1 pts Welch t = 2.57 · p = 0.012 · n = 88 / 1,743
Girls vs boys schools+0.3 pts Welch t = 0.38 · p = 0.705 — not significant
School size vs proficiencyρ = -0.042 Spearman · p = 0.071 — no material relationship
Accuracy of derived 1447 AH counts (back-test)99.8% exact Tested counts 1445 & 1446 · regional rate error < 0.01

Pipeline excerpt

nafs_pipeline.py
# DQ-06 reconciliation: computed proficiency vs the official department average
for (year, grade, subject, gender), x in main.groupby([...]):
    calc = 100 * x["proficient"].sum() / x["tested"].sum()
    diff = calc - x["ref_dept"].mode()[0]          # 48 / 48 → 0.0

# 1447 has no counts: every result of a school-grade shares one tested count,
# so the count is the LCM of the reduced denominators of its 7–12 shares
q = Fraction(share).limit_denominator(5000).denominator
n[school, grade] = math.lcm(*q_of_all_results)    # 99.8% exact on 1446

# Priority = below average AND declining more than the region
wide["priority"] = (rate_1447 <= region - 5) \
                 & (change - region_change <= -5) & (n >= 25)
  • DataAseer school-level Nafs report 1444–1446 AH and the consolidated 1447 AH Nafs results file (all schools and sub-domains): 77,076 + 30,649 rows for 2,308 schools.
  • MeasureProficiency = proficient ÷ tested, where proficient means the medium or high level. Average scores are not compared across years because their scale changed in 1447 AH.
  • 1447 AH countsThe published proficiency is an exact fraction (proficient ÷ tested). Because all results of a school-grade share one tested count, that count is the LCM of the denominators of its shares. Back-test: 99.79% exact in 1446 and 99.91% in 1445.
  • PrivacyThe public version contains no school names or ministerial numbers, and any slice with fewer than 3 schools is suppressed.

Static Python outputs for reports

Source: Aseer school-level Nafs report 1444–1446 AH and the consolidated 1447 AH Nafs results file (all schools and sub-domains). 1444–1446 AH figures are actual and reconciled to official averages; 1447 AH figures are computed from school shares with mathematically derived tested counts (99.8% exact in back-testing).