2017-2018/Notes/601/Notes CMT3.ipynb

502 lines
15 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calcul des notes pour le calcul mental du T3\n",
"\n",
"Il y a 11 évaluations qu'on voudrait découper en 3 compétences."
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd\n",
"from math import ceil\n",
"from repytex.tools.scores import mark_value_2level\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Élève</th>\n",
" <th>CM01</th>\n",
" <th>CM02</th>\n",
" <th>CM03</th>\n",
" <th>CM04</th>\n",
" <th>CM05</th>\n",
" <th>CM06</th>\n",
" <th>CM07</th>\n",
" <th>CM08</th>\n",
" <th>CM09</th>\n",
" <th>CM10</th>\n",
" <th>CM11</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>ABDALLAH Laetitia</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>2.0</td>\n",
" <td>4.0</td>\n",
" <td>3.0</td>\n",
" <td>3.0</td>\n",
" <td>2.0</td>\n",
" <td>2.0</td>\n",
" <td>0.0</td>\n",
" <td>2.0</td>\n",
" <td>4.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>ABDALLAH Lina</td>\n",
" <td>4.0</td>\n",
" <td>3.0</td>\n",
" <td>1.0</td>\n",
" <td>3.0</td>\n",
" <td>4.0</td>\n",
" <td>3.0</td>\n",
" <td>2.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>2.0</td>\n",
" <td>4.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>ABDILLAH Naib</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>NaN</td>\n",
" <td>0.0</td>\n",
" <td>2.0</td>\n",
" <td>1.0</td>\n",
" <td>2.0</td>\n",
" <td>2.0</td>\n",
" <td>3.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>ABDOU AHMED Zaher</td>\n",
" <td>4.0</td>\n",
" <td>3.0</td>\n",
" <td>3.0</td>\n",
" <td>4.0</td>\n",
" <td>4.0</td>\n",
" <td>3.0</td>\n",
" <td>3.0</td>\n",
" <td>2.0</td>\n",
" <td>4.0</td>\n",
" <td>3.0</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>ABDOU Samima</td>\n",
" <td>3.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>3.0</td>\n",
" <td>1.0</td>\n",
" <td>2.0</td>\n",
" <td>2.0</td>\n",
" <td>1.0</td>\n",
" <td>2.0</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Élève CM01 CM02 CM03 CM04 CM05 CM06 CM07 CM08 CM09 \\\n",
"0 ABDALLAH Laetitia 1.0 1.0 2.0 4.0 3.0 3.0 2.0 2.0 0.0 \n",
"1 ABDALLAH Lina 4.0 3.0 1.0 3.0 4.0 3.0 2.0 1.0 1.0 \n",
"2 ABDILLAH Naib 0.0 1.0 NaN 0.0 2.0 1.0 2.0 2.0 3.0 \n",
"3 ABDOU AHMED Zaher 4.0 3.0 3.0 4.0 4.0 3.0 3.0 2.0 4.0 \n",
"4 ABDOU Samima 3.0 1.0 1.0 1.0 3.0 1.0 2.0 2.0 1.0 \n",
"\n",
" CM10 CM11 \n",
"0 2.0 4.0 \n",
"1 2.0 4.0 \n",
"2 1.0 0.0 \n",
"3 3.0 2.0 \n",
"4 2.0 2.0 "
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"score_file = \"./601_CM_T3.csv\"\n",
"df = pd.read_csv(score_file)\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Élève\n",
"ABDALLAH Laetitia [1.0, 1.0, 2.0, 4.0, 3.0, 3.0, 2.0, 2.0, 0.0, ...\n",
"ABDALLAH Lina [4.0, 3.0, 1.0, 3.0, 4.0, 3.0, 2.0, 1.0, 1.0, ...\n",
"ABDILLAH Naib [0.0, 1.0, 0.0, 2.0, 1.0, 2.0, 2.0, 3.0, 1.0, ...\n",
"ABDOU AHMED Zaher [4.0, 3.0, 3.0, 4.0, 4.0, 3.0, 3.0, 2.0, 4.0, ...\n",
"ABDOU Samima [3.0, 1.0, 1.0, 1.0, 3.0, 1.0, 2.0, 2.0, 1.0, ...\n",
"ABOUTOIHI Nasra [3.0, 4.0, 2.0, 4.0, 3.0, 3.0, 2.0, 2.0, 4.0, ...\n",
"AHAMADI SAID Aynoudine [4.0, 2.0, 1.0, 2.0, 4.0, 3.0, 3.0, 1.0, 2.0, ...\n",
"AHMED Rayna [3.0, 2.0, 1.0, 2.0, 4.0, 2.0, 2.0, 2.0, 3.0, ...\n",
"AKIDACHI Youssouf [4.0, 3.0, 4.0, 3.0, 2.0, 3.0, 3.0, 2.0, 2.0]\n",
"ALAWI Naim [1.0, 1.0, 0.0, 0.0, 2.0, 2.0, 3.0, 1.0, 3.0, ...\n",
"ALI Estein [3.0, 3.0, 3.0, 4.0, 4.0, 3.0, 4.0, 2.0, 4.0]\n",
"ALLAOUI Nissouoiti [2.0, 1.0, 1.0, 3.0, 1.0, 2.0, 2.0, 1.0, 2.0]\n",
"ANDHUME OUSSENI Any [4.0, 3.0, 3.0, 3.0, 4.0, 2.0, 3.0, 4.0, 4.0, ...\n",
"ANDRE DICK Arson [4.0, 2.0, 3.0, 1.0, 3.0, 3.0, 2.0, 1.0, 3.0]\n",
"ANLI Aboubacar [2.0, 1.0, 3.0, 3.0, 4.0, 4.0, 2.0, 3.0, 2.0, ...\n",
"ATTOUMANE SAID Onzaïrati [1.0, 2.0, 2.0, 2.0, 3.0, 1.0, 2.0, 2.0, 1.0, ...\n",
"ATTOUMANI OUSSENI Arlette [1.0, 2.0, 3.0, 2.0, 3.0, 1.0, 3.0, 1.0, 3.0, ...\n",
"BACO Raissa [2.0, 2.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0, 2.0]\n",
"CHARAFOU Bahati [2.0, 1.0, 0.0, 4.0, 4.0, 1.0, 4.0, 3.0, 2.0]\n",
"CHARF-EDDINE Iyane [1.0, 1.0, 3.0, 3.0, 4.0, 4.0, 3.0, 2.0, 4.0, ...\n",
"DAOU Ismaël [4.0, 4.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 4.0, ...\n",
"HALIFA El -Enrif [1.0, 0.0, 1.0, 1.0, 3.0, 1.0, 2.0, 1.0, 3.0, ...\n",
"HAMADA Nadjima-Sophie [0.0, 2.0, 2.0, 1.0, 2.0, 1.0, 0.0, 2.0, 2.0]\n",
"HOUMADI Zahara [0.0, 1.0, 0.0, 2.0, 2.0, 1.0, 0.0, 1.0, 0.0, ...\n",
"IBRAHIM Nasser [1.0, 1.0, 1.0, 3.0, 3.0, 2.0, 2.0, 2.0, 2.0, ...\n",
"dtype: object"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"st_scores = df.set_index(\"Élève\").unstack().dropna().groupby(\"Élève\").apply(lambda x: list(x))\n",
"st_scores"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[array([0, 1, 2, 3]), array([4, 5, 6]), array([7, 8, 9])]"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.array_split(list(range(10)), 3)"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sc0</th>\n",
" <th>sc1</th>\n",
" <th>sc2</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>ABDALLAH Laetitia</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ABDALLAH Lina</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ABDILLAH Naib</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ABDOU AHMED Zaher</th>\n",
" <td>3</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ABDOU Samima</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ABOUTOIHI Nasra</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AHAMADI SAID Aynoudine</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AHMED Rayna</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AKIDACHI Youssouf</th>\n",
" <td>3</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ALAWI Naim</th>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ALI Estein</th>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ALLAOUI Nissouoiti</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ANDHUME OUSSENI Any</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ANDRE DICK Arson</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ANLI Aboubacar</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ATTOUMANE SAID Onzaïrati</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ATTOUMANI OUSSENI Arlette</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BACO Raissa</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CHARAFOU Bahati</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CHARF-EDDINE Iyane</th>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DAOU Ismaël</th>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>HALIFA El -Enrif</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>HAMADA Nadjima-Sophie</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>HOUMADI Zahara</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>IBRAHIM Nasser</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" sc0 sc1 sc2\n",
"ABDALLAH Laetitia 2 2 2\n",
"ABDALLAH Lina 2 2 2\n",
"ABDILLAH Naib 1 1 1\n",
"ABDOU AHMED Zaher 3 2 2\n",
"ABDOU Samima 1 2 1\n",
"ABOUTOIHI Nasra 2 2 3\n",
"AHAMADI SAID Aynoudine 2 2 2\n",
"AHMED Rayna 2 2 2\n",
"AKIDACHI Youssouf 3 2 2\n",
"ALAWI Naim 0 2 2\n",
"ALI Estein 2 3 3\n",
"ALLAOUI Nissouoiti 1 2 1\n",
"ANDHUME OUSSENI Any 2 2 3\n",
"ANDRE DICK Arson 2 2 2\n",
"ANLI Aboubacar 2 2 2\n",
"ATTOUMANE SAID Onzaïrati 1 2 1\n",
"ATTOUMANI OUSSENI Arlette 2 2 2\n",
"BACO Raissa 1 1 1\n",
"CHARAFOU Bahati 1 2 2\n",
"CHARF-EDDINE Iyane 2 2 3\n",
"DAOU Ismaël 3 3 3\n",
"HALIFA El -Enrif 1 1 2\n",
"HAMADA Nadjima-Sophie 1 1 1\n",
"HOUMADI Zahara 1 1 1\n",
"IBRAHIM Nasser 1 2 2"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"datas = {}\n",
"for e,v in st_scores.iteritems():\n",
" datas[e] = {}\n",
" for i, chunk in enumerate(np.array_split(v, 3)):\n",
" datas[e]['sc'+str(i)] = mark_value_2level(sum(chunk), 4*len(chunk))\n",
"datas = pd.DataFrame(datas).T\n",
"datas"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"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.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}