From 7bb224a48f95206b5f1b042e7402ed8058d57a44 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 20 Aug 2019 21:15:39 +0200 Subject: [PATCH] Feat: Base for student exploration --- recopytex/__init__.py | 2 +- recopytex/csv_extraction.py | 47 +- templates/tpl_evaluation.ipynb | 350 ++++++----- templates/tpl_student.ipynb | 1047 +++++++++++++++++++++++++++++++- 4 files changed, 1281 insertions(+), 165 deletions(-) diff --git a/recopytex/__init__.py b/recopytex/__init__.py index ab1cdbe..3c672c9 100644 --- a/recopytex/__init__.py +++ b/recopytex/__init__.py @@ -1,5 +1,5 @@ #!/usr/bin/env python # encoding: utf-8 -from .csv_extraction import flat_clear_csv +from .csv_extraction import flat_df_students, flat_df_for from .df_marks_manip import pp_q_scores diff --git a/recopytex/csv_extraction.py b/recopytex/csv_extraction.py index 0844e00..08e16fa 100644 --- a/recopytex/csv_extraction.py +++ b/recopytex/csv_extraction.py @@ -8,6 +8,7 @@ from .config import NO_ST_COLUMNS, COLUMNS, VALIDSCORE pd.set_option("Precision", 2) + def try_replace(x, old, new): try: return str(x).replace(old, new) @@ -26,8 +27,10 @@ def extract_students(df, no_student_columns=NO_ST_COLUMNS.values()): return students -def flat_df_students(df, no_student_columns=NO_ST_COLUMNS.values()): - """ Flat the ws for students +def flat_df_students( + df, no_student_columns=NO_ST_COLUMNS.values(), postprocessing=True +): + """ Flat the dataframe by returning a dataframe with on student on each line :param df: the dataframe (one row per questions) :param no_student_columns: columns that are not students @@ -52,18 +55,45 @@ def flat_df_students(df, no_student_columns=NO_ST_COLUMNS.values()): value_name=COLUMNS["score"], ).dropna(subset=[COLUMNS["score"]]) ) + if postprocessing: + return postprocess(pd.concat(scores)) return pd.concat(scores) -def flat_clear_csv(csv_df, no_student_columns=NO_ST_COLUMNS.values()): - """ Flat and clear the dataframe extracted from csv +def flat_df_for( + df, student, no_student_columns=NO_ST_COLUMNS.values(), postprocessing=True +): + """ Extract the data only for one student - :param csv_df: data frame read from csv + :param df: the dataframe (one row per questions) :param no_student_columns: columns that are not students :return: dataframe with one row per questions and students + Columns of csv files: + + - NO_ST_COLUMNS meta data on questions + - one for each students + + """ + students = extract_students(df, no_student_columns) + if student not in students: + raise KeyError("This student is not in the table") + st_df = df[list(no_student_columns) + [student]] + st_df = st_df.rename(columns={student: COLUMNS["score"]}).dropna( + subset=[COLUMNS["score"]] + ) + if postprocessing: + return postprocess(st_df) + return st_df + + +def postprocess(df): + """ Postprocessing score dataframe + + - Replace na with an empty string + - Replace "NOANSWER" with -1 + - Turn commas number to dot numbers """ - df = flat_df_students(csv_df) df[COLUMNS["question"]].fillna("", inplace=True) df[COLUMNS["exercise"]].fillna("", inplace=True) @@ -76,9 +106,8 @@ def flat_clear_csv(csv_df, no_student_columns=NO_ST_COLUMNS.values()): .apply(lambda x: try_replace(x, ",", ".")) ) df[COLUMNS["score_rate"]] = pd.to_numeric( - df[COLUMNS["score_rate"]] - .apply(lambda x: try_replace(x, ",", ".")), - errors="coerce" + df[COLUMNS["score_rate"]].apply(lambda x: try_replace(x, ",", ".")), + errors="coerce", ) return df diff --git a/templates/tpl_evaluation.ipynb b/templates/tpl_evaluation.ipynb index ac851cb..c544be2 100644 --- a/templates/tpl_evaluation.ipynb +++ b/templates/tpl_evaluation.ipynb @@ -2,8 +2,20 @@ "cells": [ { "cell_type": "code", - "execution_count": 16, - "metadata": {}, + "execution_count": 1, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": true + } + } + } + } + }, "outputs": [], "source": [ "from IPython.display import Markdown as md\n", @@ -11,7 +23,7 @@ "import pandas as pd\n", "from pathlib import Path\n", "from datetime import datetime\n", - "from recopytex import flat_clear_csv, pp_q_scores\n", + "from recopytex import flat_df_students, pp_q_scores\n", "#import prettytable as pt\n", "%matplotlib inline" ] @@ -20,6 +32,17 @@ "cell_type": "code", "execution_count": 2, "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": true + } + } + } + }, "tags": [ "parameters" ] @@ -35,7 +58,19 @@ { "cell_type": "code", "execution_count": 3, - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": false + } + } + } + } + }, "outputs": [ { "data": { @@ -59,107 +94,65 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": {}, + "execution_count": 5, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": true + } + } + } + } + }, "outputs": [], "source": [ "stack_scores = pd.read_csv(csv_file, encoding=\"latin_1\")\n", - "scores = flat_clear_csv(stack_scores).dropna(subset=[\"Score\"])\n", + "scores = flat_df_students(stack_scores).dropna(subset=[\"Score\"])\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", - "
NoteBareme
ExerciceEleve
1ABDOU Asmahane3.676.0
ABOU Roihim0.006.0
AHMED BOINALI Kouraichia1.336.0
AHMED Rahada2.676.0
ALI SAID Anchourati0.006.0
\n", - "
" - ], - "text/plain": [ - " Note Bareme\n", - "Exercice Eleve \n", - "1 ABDOU Asmahane 3.67 6.0\n", - " ABOU Roihim 0.00 6.0\n", - " AHMED BOINALI Kouraichia 1.33 6.0\n", - " AHMED Rahada 2.67 6.0\n", - " ALI SAID Anchourati 0.00 6.0" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" + "execution_count": 6, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": true + } + } + } } - ], + }, + "outputs": [], "source": [ "exercises_scores = scores.groupby([\"Exercice\", \"Eleve\"]).agg({\"Note\": \"sum\", \"Bareme\": \"sum\"})\n", - "exercises_scores.head()" + "#exercises_scores.head()" ] }, { "cell_type": "code", - "execution_count": 15, - "metadata": {}, + "execution_count": 7, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": false + } + } + } + } + }, "outputs": [ { "data": { @@ -195,117 +188,117 @@ " \n", " ABDOU Asmahane\n", " 5.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " ABOU Roihim\n", " 0.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " AHMED BOINALI Kouraichia\n", " 2.67\n", - " 12.0\n", + " 12\n", " \n", " \n", " AHMED Rahada\n", " 6.33\n", - " 12.0\n", + " 12\n", " \n", " \n", " ALI SAID Anchourati\n", " 0.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " ASSANE Noussouraniya\n", " 4.67\n", - " 12.0\n", + " 12\n", " \n", " \n", " BACAR Issiaka\n", " 0.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " BACAR Samina\n", " 3.67\n", - " 12.0\n", + " 12\n", " \n", " \n", " CHAIHANE Said\n", " 5.33\n", - " 12.0\n", + " 12\n", " \n", " \n", " COMBO Houzaimati\n", " 5.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " DAOUD Anzilati\n", " 5.17\n", - " 12.0\n", + " 12\n", " \n", " \n", " DAOUD Talaenti\n", " 5.67\n", - " 12.0\n", + " 12\n", " \n", " \n", " DARKAOUI Rachma\n", " 5.67\n", - " 12.0\n", + " 12\n", " \n", " \n", " DHAKIOINE Nabaouya\n", " 1.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " DJANFAR Soioutinour\n", " 5.33\n", - " 12.0\n", + " 12\n", " \n", " \n", " DRISSA Ibrahim\n", " 0.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " HACHIM SIDI Assani\n", " 7.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " HAFIDHUI Zalifa\n", " 5.67\n", - " 12.0\n", + " 12\n", " \n", " \n", " HOUMADI Marie\n", " 6.67\n", - " 12.0\n", + " 12\n", " \n", " \n", " HOUMADI Sania\n", " 5.33\n", - " 12.0\n", + " 12\n", " \n", " \n", " MAANDHUI Halouoi\n", " 7.00\n", - " 12.0\n", + " 12\n", " \n", " \n", " MASSONDI Nasma\n", " 7.33\n", - " 12.0\n", + " 12\n", " \n", " \n", " SAIDALI Irichad\n", " 5.00\n", - " 12.0\n", + " 12\n", " \n", " \n", "\n", @@ -314,32 +307,32 @@ "text/plain": [ " Note Bareme\n", "Eleve \n", - "ABDOU Asmahane 5.00 12.0\n", - "ABOU Roihim 0.00 12.0\n", - "AHMED BOINALI Kouraichia 2.67 12.0\n", - "AHMED Rahada 6.33 12.0\n", - "ALI SAID Anchourati 0.00 12.0\n", - "ASSANE Noussouraniya 4.67 12.0\n", - "BACAR Issiaka 0.00 12.0\n", - "BACAR Samina 3.67 12.0\n", - "CHAIHANE Said 5.33 12.0\n", - "COMBO Houzaimati 5.00 12.0\n", - "DAOUD Anzilati 5.17 12.0\n", - "DAOUD Talaenti 5.67 12.0\n", - "DARKAOUI Rachma 5.67 12.0\n", - "DHAKIOINE Nabaouya 1.00 12.0\n", - "DJANFAR Soioutinour 5.33 12.0\n", - "DRISSA Ibrahim 0.00 12.0\n", - "HACHIM SIDI Assani 7.00 12.0\n", - "HAFIDHUI Zalifa 5.67 12.0\n", - "HOUMADI Marie 6.67 12.0\n", - "HOUMADI Sania 5.33 12.0\n", - "MAANDHUI Halouoi 7.00 12.0\n", - "MASSONDI Nasma 7.33 12.0\n", - "SAIDALI Irichad 5.00 12.0" + "ABDOU Asmahane 5.00 12\n", + "ABOU Roihim 0.00 12\n", + "AHMED BOINALI Kouraichia 2.67 12\n", + "AHMED Rahada 6.33 12\n", + "ALI SAID Anchourati 0.00 12\n", + "ASSANE Noussouraniya 4.67 12\n", + "BACAR Issiaka 0.00 12\n", + "BACAR Samina 3.67 12\n", + "CHAIHANE Said 5.33 12\n", + "COMBO Houzaimati 5.00 12\n", + "DAOUD Anzilati 5.17 12\n", + "DAOUD Talaenti 5.67 12\n", + "DARKAOUI Rachma 5.67 12\n", + "DHAKIOINE Nabaouya 1.00 12\n", + "DJANFAR Soioutinour 5.33 12\n", + "DRISSA Ibrahim 0.00 12\n", + "HACHIM SIDI Assani 7.00 12\n", + "HAFIDHUI Zalifa 5.67 12\n", + "HOUMADI Marie 6.67 12\n", + "HOUMADI Sania 5.33 12\n", + "MAANDHUI Halouoi 7.00 12\n", + "MASSONDI Nasma 7.33 12\n", + "SAIDALI Irichad 5.00 12" ] }, - "execution_count": 15, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -351,8 +344,20 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": {}, + "execution_count": 8, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": false + } + } + } + } + }, "outputs": [ { "data": { @@ -368,7 +373,7 @@ "Name: Note, dtype: float64" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -379,16 +384,38 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": {}, + "execution_count": 9, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": false + } + } + } + } + }, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject\n", + " return f(*args, **kwds)\n", + "/usr/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject\n", + " return f(*args, **kwds)\n" + ] + }, { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 8, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" }, @@ -413,13 +440,44 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": {}, + "report_default": { + "hidden": true + } + } + } + } + }, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Tags", + "extensions": { + "jupyter_dashboards": { + "activeView": "grid_default", + "version": 1, + "views": { + "grid_default": { + "cellMargin": 10, + "defaultCellHeight": 20, + "maxColumns": 12, + "name": "grid", + "type": "grid" + }, + "report_default": { + "name": "report", + "type": "report" + } + } + } + }, "kernelspec": { "display_name": "Python 3", "language": "python", @@ -435,7 +493,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.7.4" } }, "nbformat": 4, diff --git a/templates/tpl_student.ipynb b/templates/tpl_student.ipynb index 72fe9e4..ceef07c 100644 --- a/templates/tpl_student.ipynb +++ b/templates/tpl_student.ipynb @@ -2,18 +2,23 @@ "cells": [ { "cell_type": "code", - "execution_count": 7, + "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" + "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": 10, + "execution_count": 2, "metadata": { "tags": [ "parameters" @@ -21,26 +26,1050 @@ }, "outputs": [], "source": [ - "tribe = 30\n", + "tribe = 308\n", "student = \"ABDOU Asmahane\"\n", - "source = Path(f\"./sheets/{tribe}/\")" + "source = Path(f\"../sheets/{tribe}/\")" ] }, { "cell_type": "code", - "execution_count": 11, + "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 30" + "# ABDOU Asmahane en 308" ], "text/plain": [ "" ] }, - "execution_count": 11, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -74,7 +1103,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.7.4" } }, "nbformat": 4,