{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from IPython.display import Markdown as md\n", "from IPython.display import display\n", "import pandas as pd\n", "from pathlib import Path\n", "from datetime import datetime\n", "from recopytex import flat_df_for, pp_q_scores\n", "#import prettytable as pt\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [ "parameters" ] }, "outputs": [], "source": [ "tribe = 308\n", "student = \"ABDOU Asmahane\"\n", "source = Path(f\"../sheets/{tribe}/\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "dfs = []\n", "for file in source.glob(\"*.csv\"):\n", " df = pd.read_csv(file)\n", " df = flat_df_for(df, student)\n", " dfs.append(df)\n", "scores = pd.concat(dfs) \n", "scores = pp_q_scores(scores)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TrimestreNomDateExerciceQuestionCompetenceDomaineCommentaireBaremeEst_niveleScoreNoteNiveauNormalise
01DS205/11/1611ModFracFigure -> fraction2.01-10.00NaN0.00
11DS205/11/1612CalFracÉgalité fractions2.01-10.00NaN0.00
21DS205/11/162ComGeoCommunication2.01-10.00NaN0.00
31DS205/11/162ConGeoTableau2.01-10.00NaN0.00
41DS205/11/162CalGeoCalculs2.01-10.00NaN0.00
51DS205/11/1631 à 3CheOpeMettre en valeur les informations1.51-10.00NaN0.00
61DS205/11/1631 à 3CalOpeChoisir et faire les calculs1.01-10.00NaN0.00
71DS205/11/1631 à 3ComOpePhrases et étapes1.51-10.00NaN0.00
81DS205/11/1641CheGeo3DRemplir le tableau2.01-10.00NaN0.00
91DS205/11/1641CalLittCalcul s+f-a1.01-10.00NaN0.00
01DM115/09/1611.1CalPrio1.0120.672.00.67
11DM115/09/1611.2CalPrio1.0131.003.01.00
21DM115/09/1611.3CalPrio1.0120.672.00.67
31DM115/09/1611.4CalPrio1.0120.672.00.67
41DM115/09/1611.5CalPrio1.0120.672.00.67
51DM115/09/1611.6CalPrio1.0100.000.00.00
61DM115/09/1622.1ComProba1.0110.331.00.33
71DM115/09/1622.2 à 2.4ComProbaNotation P(...)1.0100.000.00.00
81DM115/09/1622.2 à 2.4RepProbaFractions1.0100.000.00.00
91DM115/09/1622.2 à 2.4DivProbarésultat1.01-10.00NaN0.00
101DM115/09/1622.5RaiProba1.01-10.00NaN0.00
111DM115/09/16MalusRetardDivDiv0.00-10.00NaNNaN
121DM115/09/16PresentationComDiv1.0011.003.01.00
01DS124/09/1611.aCalPrio1.5131.503.01.00
11DS124/09/1611.bCalPrio1.5100.000.00.00
21DS124/09/1611.cCalPrio1.5131.503.01.00
31DS124/09/1611.dCalPrio1.5131.503.01.00
41DS124/09/1621RecProba1.0110.331.00.33
51DS124/09/1622CalProba1.0120.672.00.67
61DS124/09/1623 à 5ComProbaNotation1.5110.501.00.33
71DS124/09/1623 à 5RepProbaFraction1.5121.002.00.67
81DS124/09/1623 à 5DivProbaRésultat1.0100.000.00.00
91DS124/09/163ComScraExplication1.5110.501.00.33
101DS124/09/163CheScraTrouver erreur1.5110.501.00.33
111DS124/09/1641 et 2CheOpe1.0131.003.01.00
121DS124/09/1641 et 2ComOpe1.5121.002.00.67
131DS124/09/1641 et 2CalOpe1.5131.503.01.00
\n", "
" ], "text/plain": [ " Trimestre Nom Date Exercice Question Competence Domaine \\\n", "0 1 DS2 05/11/16 1 1 Mod Frac \n", "1 1 DS2 05/11/16 1 2 Cal Frac \n", "2 1 DS2 05/11/16 2 Com Geo \n", "3 1 DS2 05/11/16 2 Con Geo \n", "4 1 DS2 05/11/16 2 Cal Geo \n", "5 1 DS2 05/11/16 3 1 à 3 Che Ope \n", "6 1 DS2 05/11/16 3 1 à 3 Cal Ope \n", "7 1 DS2 05/11/16 3 1 à 3 Com Ope \n", "8 1 DS2 05/11/16 4 1 Che Geo3D \n", "9 1 DS2 05/11/16 4 1 Cal Litt \n", "0 1 DM1 15/09/16 1 1.1 Cal Prio \n", "1 1 DM1 15/09/16 1 1.2 Cal Prio \n", "2 1 DM1 15/09/16 1 1.3 Cal Prio \n", "3 1 DM1 15/09/16 1 1.4 Cal Prio \n", "4 1 DM1 15/09/16 1 1.5 Cal Prio \n", "5 1 DM1 15/09/16 1 1.6 Cal Prio \n", "6 1 DM1 15/09/16 2 2.1 Com Proba \n", "7 1 DM1 15/09/16 2 2.2 à 2.4 Com Proba \n", "8 1 DM1 15/09/16 2 2.2 à 2.4 Rep Proba \n", "9 1 DM1 15/09/16 2 2.2 à 2.4 Div Proba \n", "10 1 DM1 15/09/16 2 2.5 Rai Proba \n", "11 1 DM1 15/09/16 Malus Retard Div Div \n", "12 1 DM1 15/09/16 Presentation Com Div \n", "0 1 DS1 24/09/16 1 1.a Cal Prio \n", "1 1 DS1 24/09/16 1 1.b Cal Prio \n", "2 1 DS1 24/09/16 1 1.c Cal Prio \n", "3 1 DS1 24/09/16 1 1.d Cal Prio \n", "4 1 DS1 24/09/16 2 1 Rec Proba \n", "5 1 DS1 24/09/16 2 2 Cal Proba \n", "6 1 DS1 24/09/16 2 3 à 5 Com Proba \n", "7 1 DS1 24/09/16 2 3 à 5 Rep Proba \n", "8 1 DS1 24/09/16 2 3 à 5 Div Proba \n", "9 1 DS1 24/09/16 3 Com Scra \n", "10 1 DS1 24/09/16 3 Che Scra \n", "11 1 DS1 24/09/16 4 1 et 2 Che Ope \n", "12 1 DS1 24/09/16 4 1 et 2 Com Ope \n", "13 1 DS1 24/09/16 4 1 et 2 Cal Ope \n", "\n", " Commentaire Bareme Est_nivele Score Note \\\n", "0 Figure -> fraction 2.0 1 -1 0.00 \n", "1 Égalité fractions 2.0 1 -1 0.00 \n", "2 Communication 2.0 1 -1 0.00 \n", "3 Tableau 2.0 1 -1 0.00 \n", "4 Calculs 2.0 1 -1 0.00 \n", "5 Mettre en valeur les informations 1.5 1 -1 0.00 \n", "6 Choisir et faire les calculs 1.0 1 -1 0.00 \n", "7 Phrases et étapes 1.5 1 -1 0.00 \n", "8 Remplir le tableau 2.0 1 -1 0.00 \n", "9 Calcul s+f-a 1.0 1 -1 0.00 \n", "0 1.0 1 2 0.67 \n", "1 1.0 1 3 1.00 \n", "2 1.0 1 2 0.67 \n", "3 1.0 1 2 0.67 \n", "4 1.0 1 2 0.67 \n", "5 1.0 1 0 0.00 \n", "6 1.0 1 1 0.33 \n", "7 Notation P(...) 1.0 1 0 0.00 \n", "8 Fractions 1.0 1 0 0.00 \n", "9 résultat 1.0 1 -1 0.00 \n", "10 1.0 1 -1 0.00 \n", "11 0.0 0 -1 0.00 \n", "12 1.0 0 1 1.00 \n", "0 1.5 1 3 1.50 \n", "1 1.5 1 0 0.00 \n", "2 1.5 1 3 1.50 \n", "3 1.5 1 3 1.50 \n", "4 1.0 1 1 0.33 \n", "5 1.0 1 2 0.67 \n", "6 Notation 1.5 1 1 0.50 \n", "7 Fraction 1.5 1 2 1.00 \n", "8 Résultat 1.0 1 0 0.00 \n", "9 Explication 1.5 1 1 0.50 \n", "10 Trouver erreur 1.5 1 1 0.50 \n", "11 1.0 1 3 1.00 \n", "12 1.5 1 2 1.00 \n", "13 1.5 1 3 1.50 \n", "\n", " Niveau Normalise \n", "0 NaN 0.00 \n", "1 NaN 0.00 \n", "2 NaN 0.00 \n", "3 NaN 0.00 \n", "4 NaN 0.00 \n", "5 NaN 0.00 \n", "6 NaN 0.00 \n", "7 NaN 0.00 \n", "8 NaN 0.00 \n", "9 NaN 0.00 \n", "0 2.0 0.67 \n", "1 3.0 1.00 \n", "2 2.0 0.67 \n", "3 2.0 0.67 \n", "4 2.0 0.67 \n", "5 0.0 0.00 \n", "6 1.0 0.33 \n", "7 0.0 0.00 \n", "8 0.0 0.00 \n", "9 NaN 0.00 \n", "10 NaN 0.00 \n", "11 NaN NaN \n", "12 3.0 1.00 \n", "0 3.0 1.00 \n", "1 0.0 0.00 \n", "2 3.0 1.00 \n", "3 3.0 1.00 \n", "4 1.0 0.33 \n", "5 2.0 0.67 \n", "6 1.0 0.33 \n", "7 2.0 0.67 \n", "8 0.0 0.00 \n", "9 1.0 0.33 \n", "10 1.0 0.33 \n", "11 3.0 1.00 \n", "12 2.0 0.67 \n", "13 3.0 1.00 " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "scores" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NoteBareme
NomExercice
DM113.676.0
20.335.0
Malus0.000.0
Presentation1.001.0
DS114.506.0
22.506.0
31.003.0
43.504.0
DS210.004.0
20.006.0
30.004.0
40.003.0
\n", "
" ], "text/plain": [ " Note Bareme\n", "Nom Exercice \n", "DM1 1 3.67 6.0\n", " 2 0.33 5.0\n", " Malus 0.00 0.0\n", " Presentation 1.00 1.0\n", "DS1 1 4.50 6.0\n", " 2 2.50 6.0\n", " 3 1.00 3.0\n", " 4 3.50 4.0\n", "DS2 1 0.00 4.0\n", " 2 0.00 6.0\n", " 3 0.00 4.0\n", " 4 0.00 3.0" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "exercises_scores = scores.groupby([\"Nom\", \"Exercice\"]).agg({\"Note\": \"sum\", \"Bareme\": \"sum\"})\n", "exercises_scores" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NoteBareme
Nom
DM15.012.0
DS111.519.0
DS20.017.0
\n", "
" ], "text/plain": [ " Note Bareme\n", "Nom \n", "DM1 5.0 12.0\n", "DS1 11.5 19.0\n", "DS2 0.0 17.0" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "assessment_scores = scores.groupby([\"Nom\"]).agg({\"Note\": \"sum\", \"Bareme\": \"sum\"})\n", "assessment_scores" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "# ABDOU Asmahane en 308" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "md(f\"# {student} en {tribe}\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }