recopytex/templates/tpl_evaluation.ipynb

443 lines
29 KiB
Plaintext
Raw Normal View History

2019-08-04 14:25:44 +00:00
{
"cells": [
{
"cell_type": "code",
2019-08-04 21:24:32 +00:00
"execution_count": 20,
2019-08-04 14:25:44 +00:00
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Markdown as md\n",
2019-08-04 21:24:32 +00:00
"from IPython.display import display\n",
2019-08-04 14:25:44 +00:00
"import pandas as pd\n",
2019-08-04 17:28:43 +00:00
"from pathlib import Path\n",
2019-08-04 19:57:27 +00:00
"from datetime import datetime\n",
2019-08-04 21:24:32 +00:00
"from recopytex import flat_clear_csv, pp_q_scores\n",
"%matplotlib inline"
2019-08-04 14:25:44 +00:00
]
},
{
"cell_type": "code",
2019-08-04 21:24:32 +00:00
"execution_count": 21,
"metadata": {
"tags": [
"parameters"
]
},
2019-08-04 14:25:44 +00:00
"outputs": [],
"source": [
"tribe = \"308\"\n",
2019-08-04 19:57:27 +00:00
"assessment = \"DM1\"\n",
"date = \"15/09/16\"\n",
"csv_file = Path(f\"../sheets/{tribe}/160915_{assessment}.csv\")"
2019-08-04 14:25:44 +00:00
]
},
{
"cell_type": "code",
2019-08-04 21:24:32 +00:00
"execution_count": 22,
2019-08-04 17:28:43 +00:00
"metadata": {},
2019-08-04 19:57:27 +00:00
"outputs": [
{
"data": {
"text/markdown": [
"# DM1 (15/09/16) pour 308"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2019-08-04 17:28:43 +00:00
"source": [
2019-08-04 19:57:27 +00:00
"if date is None:\n",
" display(md(f\"# {assessment} pour {tribe}\"))\n",
2019-08-04 17:28:43 +00:00
"else:\n",
2019-08-04 19:57:27 +00:00
" display(md(f\"# {assessment} ({date}) pour {tribe}\"))"
2019-08-04 17:28:43 +00:00
]
},
{
"cell_type": "code",
2019-08-04 21:24:32 +00:00
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"stack_scores = pd.read_csv(csv_file)\n",
"scores = flat_clear_csv(stack_scores).dropna(subset=[\"Score\"])\n",
"scores = pp_q_scores(scores)"
]
},
{
"cell_type": "code",
"execution_count": 24,
2019-08-04 14:25:44 +00:00
"metadata": {},
"outputs": [
{
"data": {
2019-08-04 19:57:27 +00:00
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
2019-08-04 21:24:32 +00:00
" <th></th>\n",
" <th>Note</th>\n",
" <th>Bareme</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Exercice</th>\n",
" <th>Eleve</th>\n",
" <th></th>\n",
" <th></th>\n",
2019-08-04 19:57:27 +00:00
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
2019-08-04 21:24:32 +00:00
" <th rowspan=\"5\" valign=\"top\">1</th>\n",
" <th>ABDOU Asmahane</th>\n",
" <td>3.67</td>\n",
" <td>6.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ABOU Roihim</th>\n",
" <td>0.00</td>\n",
" <td>6.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AHMED BOINALI Kouraichia</th>\n",
" <td>1.33</td>\n",
" <td>6.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AHMED Rahada</th>\n",
" <td>2.67</td>\n",
" <td>6.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ALI SAID Anchourati</th>\n",
" <td>0.00</td>\n",
" <td>6.0</td>\n",
2019-08-04 19:57:27 +00:00
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
2019-08-04 14:25:44 +00:00
],
"text/plain": [
2019-08-04 21:24:32 +00:00
" 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": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"exercises_scores = scores.groupby([\"Exercice\", \"Eleve\"]).agg({\"Note\": \"sum\", \"Bareme\": \"sum\"})\n",
"exercises_scores.head()"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
2019-08-04 19:57:27 +00:00
"\n",
2019-08-04 21:24:32 +00:00
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Note</th>\n",
" <th>Bareme</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Eleve</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>ABDOU Asmahane</th>\n",
" <td>5.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ABOU Roihim</th>\n",
" <td>0.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AHMED BOINALI Kouraichia</th>\n",
" <td>2.67</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AHMED Rahada</th>\n",
" <td>6.33</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ALI SAID Anchourati</th>\n",
" <td>0.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ASSANE Noussouraniya</th>\n",
" <td>4.67</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BACAR Issiaka</th>\n",
" <td>0.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BACAR Samina</th>\n",
" <td>3.67</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CHAIHANE Said</th>\n",
" <td>5.33</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>COMBO Houzaimati</th>\n",
" <td>5.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DAOUD Anzilati</th>\n",
" <td>5.17</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DAOUD Talaenti</th>\n",
" <td>5.67</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DARKAOUI Rachma</th>\n",
" <td>5.67</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DHAKIOINE Nabaouya</th>\n",
" <td>1.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DJANFAR Soioutinour</th>\n",
" <td>5.33</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DRISSA Ibrahim</th>\n",
" <td>0.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>HACHIM SIDI Assani</th>\n",
" <td>7.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>HAFIDHUI Zalifa</th>\n",
" <td>5.67</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>HOUMADI Marie</th>\n",
" <td>6.67</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>HOUMADI Sania</th>\n",
" <td>5.33</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>MAANDHUI Halouoi</th>\n",
" <td>7.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>MASSONDI Nasma</th>\n",
" <td>7.33</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SAIDALI Irichad</th>\n",
" <td>5.00</td>\n",
" <td>12.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"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"
2019-08-04 14:25:44 +00:00
]
},
2019-08-04 21:24:32 +00:00
"execution_count": 25,
2019-08-04 14:25:44 +00:00
"metadata": {},
2019-08-04 19:57:27 +00:00
"output_type": "execute_result"
2019-08-04 14:25:44 +00:00
}
],
"source": [
2019-08-04 21:24:32 +00:00
"assessment_scores = scores.groupby([\"Eleve\"]).agg({\"Note\": \"sum\", \"Bareme\": \"sum\"})\n",
"assessment_scores"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"count 23.00\n",
"mean 4.33\n",
"std 2.45\n",
"min 0.00\n",
"25% 3.17\n",
"50% 5.17\n",
"75% 5.67\n",
"max 7.33\n",
"Name: Note, dtype: float64"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"assessment_scores[\"Note\"].describe()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f3ce24e90d0>"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAD4CAYAAAD7CAEUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deXxU5dn/8c+VfSEkQBZCAoQdwg4BFxAVFHHFXdC69LHSVmltbfvUbtb662JXu1lbW/eqiFtFRQFBVESUsAUSCISwJGRPIAFCyHb9/piJTxoTkkAmZ2ZyvV+veWXmbPMdDXPl3Oc+9y2qijHGGNNRAU4HMMYY41uscBhjjOkUKxzGGGM6xQqHMcaYTrHCYYwxplOCnA7QHWJjYzUlJcXpGMYY41M2bdpUpqpxLZf3iMKRkpJCenq60zGMMcaniMiB1pZbU5UxxphOscJhjDGmU6xwGGOM6RQrHMYYYzrFCocxxphOscJhjDGmU6xwGGOM6ZQecR+HMaZjTtQ28HFOGTmlx1CFlH4RnDOsHzERIU5HM17ECocxhuMn6/nb2hyeWX+AYyfr/2tdSFAA109N5rtzR9E30gqIscJhTI+3s7CKr/97E/vLq7liQiILpw9iQnI0gQHCzsIqXt18iJfT81ixo4g/L5zMjOGxTkc2DpOeMANgWlqa2pAjxnzRpgMV3P7kRiJCAvnLwsmcNbRfq9vtKqrimy9uIbf0OL+7YSJXT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fEB9QyOrd5YwZ3Q8wYH+9c92bmp/jtbU8+m+cqejmA7yr99AY/zUZ/srqDxR59M3/bVl5ohYwoMDWZl
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"assessment_scores[\"Note\"].plot.kde()\n",
"assessment_scores[\"Note\"].plot.kde()"
2019-08-04 14:25:44 +00:00
]
},
{
"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",
2019-08-04 17:28:43 +00:00
"version": "3.7.4"
2019-08-04 14:25:44 +00:00
}
},
"nbformat": 4,
"nbformat_minor": 2
}