Inspiration
Public preparatory schools in Morocco have about 42 students per classroom, while private schools have only 20. I wanted this project to show the resources of every individual school, so parents choosing a school for their kids could know in advance whether it has enough resources, so their child doesn't end up overcrowded, unable to focus, unable to get good grades, without knowing where the problem really is.
But the Ministry doesn't have that data per school. I searched, and could only find aggregated national data (total students, classes, and rooms) nationally. So this project analyzes the same problem, but at a national level instead.
What it does
It reads official Ministry of Education statistics, splits them into 6 categories (Primaire / Collégial / Qualifiant × Public / Privé), calculates the students-per-classroom ratio for each, and flags which categories are overcrowded, balanced, or lightly loaded — then visualizes the result as a bar chart.
It won't tell you if one specific school is well-resourced, but it does show whether the education system your kid studies in, overall, is under pressure or not. It's not the full picture, since per-school data isn't public in Morocco yet, but it's a start.
How we built it
exploration.pydownloads the official Ministry Excel file (with a local backup fallback) and extracts the relevant numbers using pandassrc/school.pydefines aCategoryclass that calculates the students/room ratio and a crowding statussrc/optimizer.pyloads all categories from the processed CSV and partitions them by statusmain.pyprints a ranked terminal reportvisualize.pydraws a matplotlib bar chart of the results
Challenges we ran into
The Ministry's published "CSV" file was actually a messy Excel report, not a clean table — the numbers I needed were scattered between titles and blank rows, so I had to extract them by fixed row/column position instead of by column name.
Midway through the project, I also discovered that no per-school data exists publicly in Morocco, only national aggregates. That meant redesigning my original per-school model into a category-based one, after already having built it around individual schools.
Accomplishments that we're proud of
Turning a messy, non-tabular government Excel report into a clean, working data pipeline, and still getting a real, meaningful result out of it: public collégial classrooms average 42 students per room, more than double the private sector's 17-20. That's a genuine finding about Morocco's education system, not just a demo.
What we learned
This was my first time working with Excel files, I used to only work with CSV. I learned how to read multi-sheet Excel files into a dictionary by sheet name, how to clean non-null values, and how to extract data with .iloc when the file isn't a clean table. I also learned to design around real-world data limitations, rebuilding my data model once I understood what the source actually supported.
AI Disclosure
I used AI throughout this project to help me find data files, organize project structure, and correct my mistakes. I understand and can explain every part of the code and the decisions behind it.

Log in or sign up for Devpost to join the conversation.