2017-09-06 12:23:16 +00:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Exploration des résultats des 302"
]
},
{
"cell_type": "code",
"execution_count": 1,
2017-09-10 15:41:11 +00:00
"metadata": {
"collapsed": true
},
2017-09-06 12:23:16 +00:00
"outputs": [],
"source": [
"import sqlite3\n",
"import pandas as pd\n",
"import numpy as np\n",
"from math import ceil\n",
"import seaborn as sns\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"from pprint import pprint"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"db = \"recopytex.db\"\n",
"conn = sqlite3.connect(db)\n",
"c = conn.cursor()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"tribe_name = \"302\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Id de la classe de 302"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"tribe_id = c.execute(\"SELECT id from tribe WHERE tribe.name == ?\", (tribe_name,)).fetchone()[0]"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
]
}
],
"source": [
"print(tribe_id)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Evaluations disponibles"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"evals = c.execute(\"SELECT id, name from eval WHERE eval.tribe_id == ?\", (tribe_id,))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[(1, 'DS1 mise en jambe')]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"evals.fetchmany()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## DS 1 mise en jambre"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"eval_id = 1"
]
},
{
"cell_type": "code",
"execution_count": 9,
2017-09-10 15:41:11 +00:00
"metadata": {},
2017-09-06 12:23:16 +00:00
"outputs": [],
"source": [
2017-09-10 15:41:11 +00:00
"questions_scores = pd.read_sql_query(\"SELECT \\\n",
" student.name as name,\\\n",
" student.surname as surname,\\\n",
" score.value as value, \\\n",
" question.competence as competence,\\\n",
" question.name as question,\\\n",
" exercise.name as exercise, \\\n",
" eval.name as eval\\\n",
2017-09-06 12:23:16 +00:00
" FROM score\\\n",
" JOIN question ON score.question_id==question.id \\\n",
" JOIN exercise ON question.exercise_id==exercise.id \\\n",
" JOIN eval ON exercise.eval_id==eval.id \\\n",
" JOIN student ON score.student_id==student.id\\\n",
" WHERE eval.id == (?)\",\n",
" conn,\n",
" params = (eval_id,))"
]
},
2017-09-10 15:41:11 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"On efface les lignes sans \"value\""
]
},
2017-09-06 12:23:16 +00:00
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"questions_scores = questions_scores[questions_scores[\"value\"]!='']"
]
},
2017-09-10 15:41:11 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"On transforme les \"value\" en score"
]
},
2017-09-06 12:23:16 +00:00
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def note2score(x):\n",
" if x[\"value\"] == '.':\n",
" return 0\n",
" if x[\"value\"] not in [0, 1, 2, 3]:\n",
" raise ValueError(f\"The evaluation is out of range: {x['value']} at {x}\")\n",
" return x[\"value\"]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"questions_scores[\"score\"] = questions_scores.apply(note2score, axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
2017-09-10 15:41:11 +00:00
"outputs": [],
2017-09-06 12:23:16 +00:00
"source": [
2017-09-10 15:41:11 +00:00
"#questions_scores.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Nom des élèves en entier"
2017-09-06 12:23:16 +00:00
]
},
{
"cell_type": "code",
"execution_count": 14,
2017-09-10 15:41:11 +00:00
"metadata": {},
"outputs": [],
"source": [
"questions_scores[\"fullname\"] = questions_scores[\"name\"] + \" \" + questions_scores[\"surname\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Nom des compétences en entier"
]
},
{
"cell_type": "code",
"execution_count": 15,
2017-09-06 12:23:16 +00:00
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
2017-09-10 15:41:11 +00:00
"def competence_fullname(x):\n",
" competences = {\n",
" \"Cher\": \"Chercher\",\n",
" \"Mod\": \"Modéliser\",\n",
" \"Rep\": \"Représenter\",\n",
" \"Rai\": \"Raisonner\",\n",
" \"Cal\": \"Calculer\",\n",
" \"Com\": \"Communiquer\",\n",
" \"Con\": \"Connaître\"\n",
" }\n",
" try:\n",
" return competences[x['competence']]\n",
" except KeyError:\n",
" return \"\""
2017-09-06 12:23:16 +00:00
]
},
{
"cell_type": "code",
2017-09-10 15:41:11 +00:00
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"questions_scores[\"abv_competence\"] = questions_scores[\"competence\"]\n",
"questions_scores[\"competence\"] = questions_scores.apply(competence_fullname, axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 17,
2017-09-06 12:23:16 +00:00
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def score_mean(x):\n",
" mean = np.mean(x)\n",
" return round(mean, 0)\n",
"\n",
"score_mean.__name__ = \"Moyenne discrète\""
]
},
{
"cell_type": "code",
2017-09-10 15:41:11 +00:00
"execution_count": 18,
"metadata": {
"collapsed": true
},
2017-09-06 12:23:16 +00:00
"outputs": [],
"source": [
"report_comp = pd.pivot_table(questions_scores,\n",
" index=[\"fullname\"],\n",
" columns = ['competence'],\n",
" values = [\"score\"],\n",
" aggfunc = [score_mean])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Applatissement du nom des colonnes"
]
},
{
"cell_type": "code",
2017-09-10 15:41:11 +00:00
"execution_count": 19,
"metadata": {
"collapsed": true
},
2017-09-06 12:23:16 +00:00
"outputs": [],
"source": [
"report_comp.columns = report_comp.columns.levels[-1]"
]
},
{
"cell_type": "code",
2017-09-10 15:41:11 +00:00
"execution_count": 20,
2017-09-06 12:23:16 +00:00
"metadata": {},
"outputs": [
{
2017-09-10 15:41:11 +00:00
"ename": "TypeError",
"evalue": "cannot do slice indexing on <class 'pandas.core.indexes.base.Index'> with these indexers [ name surname value competence question \\\n0 ABDALLAH ALLAOUI Taiassima 2 Chercher 1 \n1 ABDALLAH ALLAOUI Taiassima 2 Calculer 2 \n2 ABDALLAH ALLAOUI Taiassima . Calculer 2.c \n3 ADANI Ismou 2 Chercher 1 \n4 ADANI Ismou 2 Calculer 2 \n5 ADANI Ismou 1 Calculer 2.c \n6 AHAMADA Dhoulkamal 3 Chercher 1 \n7 AHAMADA Dhoulkamal 0 Calculer 2 \n8 AHAMADA Dhoulkamal 0 Calculer 2.c \n9 AHAMADI Asbahati 3 Chercher 1 \n10 AHAMADI Asbahati 3 Calculer 2 \n11 AHAMADI Asbahati 0 Calculer 2.c \n12 AHAMADI OUSSENI Ansufiddine 1 Chercher 1 \n13 AHAMADI OUSSENI Ansufiddine 2 Calculer 2 \n14 AHAMADI OUSSENI Ansufiddine . Calculer 2.c \n15 AHAMED Fayadhi 3 Chercher 1 \n16 AHAMED Fayadhi 2 Calculer 2 \n17 AHAMED Fayadhi 0 Calculer 2.c \n18 AHMED SAID Hadaïta 2 Chercher 1 \n19 AHMED SAID Hadaïta 2 Calculer 2 \n20 AHMED SAID Hadaïta 2 Calculer 2.c \n21 ALI Raydel 2 Chercher 1 \n22 ALI Raydel 0 Calculer 2 \n23 ALI Raydel 2 Calculer 2.c \n24 ALI MADI Anissa 3 Chercher 1 \n25 ALI MADI Anissa 1 Calculer 2 \n26 ALI MADI Anissa 0 Calculer 2.c \n27 ATTOUMANE ALI Fatima 1 Chercher 1 \n28 ATTOUMANE ALI Fatima 2 Calculer 2 \n29 ATTOUMANE ALI Fatima 0 Calculer 2.c \n... ... ... ... ... ... \n3922 MOHAMED Nadia . Chercher \n3923 MOHAMED Nadia . Chercher \n3924 MOHAMED Nadia . Raisonner \n3925 MOHAMED Nadia . Calculer \n3926 MOHAMED Nadia . Communiquer \n3927 MOUHOUDHOIRE Izak 0 Chercher \n3928 MOUHOUDHOIRE Izak . Chercher \n3929 MOUHOUDHOIRE Izak . Raisonner \n3930 MOUHOUDHOIRE Izak . Calculer \n3931 MOUHOUDHOIRE Izak . Communiquer \n3932 MOUSSRI Bakari 3 Chercher \n3933 MOUSSRI Bakari 1 Chercher \n3934 MOUSSRI Bakari 1 Raisonner \n3935 MOUSSRI Bakari 1 Calculer \n3936 MOUSSRI Bakari 1 Communiquer \n3937 SAKOTRA Claudiana . Chercher \n3938 SAKOTRA Claudiana . Chercher \n3939 SAKOTRA Claudiana . Raisonner \n3940 SAKOTRA Claudiana . Calculer \n3941 SAKOTRA Claudiana 1 Communiquer \n3942 SAÏD Fatoumia 3 Chercher \n3943 SAÏD Fatoumia 3 Chercher \n3944 SAÏD Fatoumia 3 Raisonner \n3945 SAÏD Fatoumia 2 Calculer \n3946 SAÏD Fatoumia 2 Communiquer \n3947 TOUFAIL Salahou 3 Chercher \n3948 TOUFAIL Salahou
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-20-b319a0b09f0a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mreport_comp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhead\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mquestions_scores\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36mhead\u001b[0;34m(self, n)\u001b[0m\n\u001b[1;32m 2731\u001b[0m \u001b[0mReturns\u001b[0m \u001b[0mfirst\u001b[0m \u001b[0mn\u001b[0m \u001b[0mrows\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2732\u001b[0m \"\"\"\n\u001b[0;32m-> 2733\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0miloc\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2734\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2735\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mtail\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/indexing.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 1326\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1327\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_apply_if_callable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1328\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_getitem_axis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1329\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1330\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_is_scalar_access\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/indexing.py\u001b[0m in \u001b[0;36m_getitem_axis\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m 1722\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mslice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1723\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_has_valid_type\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1724\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_slice_axis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1725\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1726\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/indexing.py\u001b[0m in \u001b[0;36m_get_slice_axis\u001b[0;34m(self, slice_obj, axis)\u001b[0m\n\u001b[1;32m 1693\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mobj\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1694\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1695\u001b[0;31m \u001b[0mslice_obj\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_convert_slice_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mslice_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1696\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mslice_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mslice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1697\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_slice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mslice_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkind\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'iloc'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/indexing.py\u001b[0m in \u001b[0;36m_convert_slice_indexer\u001b[0;34m(self, key, axis)\u001b[0m\n\u001b[1;32m 239\u001b[0m \u001b[0;31m# if we are accessing via lowered dim, use the last dim\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 240\u001b[0m \u001b[0max\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_axis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mndim\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 241\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0max\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_convert_slice_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkind\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 242\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 243\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_has_valid_setitem_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindexer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36m_convert_slice_indexer\u001b[0;34m(self, key, kind)\u001b[0m\n\u001b[1;32m 1360\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mkind\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'iloc'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1361\u001b[0m return slice(self._validate_indexer('slice', key.start, kind),\n\u001b[0;32m-> 1362\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_validate_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'slice'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkind\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1363\u001b[0m self._validate_indexer('slice', key.step, kind))\n\u001b[1;32m 1364\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36m_validate_indexer\u001b[0;34m(self, form, key, kind)\u001b[0m\n\u001b[1;32m 3386\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3387\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mkind\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m'iloc'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'getitem'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3388\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_invalid_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mform\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3389\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3390\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Cours/Prof/Enseignements/2017-2018/.venv/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36m_invalid_indexer\u001b[0;34m(self, form, key)\u001b[0m\n\u001b[1;32m 1517\u001b[0m \"indexers [{key}] of {kind}\".format(\n\u001b[1;32m 1518\u001b[0m \u001b[0mform\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mform\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mklass\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1519\u001b[0;31m kind=type(key)))\n\u001b[0m\u001b[1;32m 1520\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1521\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mget_duplicates\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mTypeError\u001b[0m: cannot do slice indexing on <class 'pandas.core.indexes.base.Index'> with these indexers [ name surname value competence question \\\n0 ABDALLAH ALLAOUI Taiassima 2 Chercher 1 \n1 ABDALLAH ALLAOUI Taiassima 2 Calculer 2 \n2 ABDALLAH ALLAOUI Taiassima . Calculer 2.c \n3 ADANI Ismou 2 Chercher 1 \n4 ADANI Ismou 2 Calculer 2 \n5 ADANI Ismou 1 Calculer 2.c \n6 AHAMADA Dhoulkamal 3 Chercher 1 \n7 AHAMADA Dhoulkamal 0 Calculer 2 \n8 AHAMADA Dhoulkamal 0 Calculer 2.c \n9 AHAMADI Asbahati 3 Chercher 1 \n10 AHAMADI Asbahati 3 Calculer 2 \n11 AHAMADI Asbahati 0 Calculer 2.c \n12 AHAMADI OUSSENI Ansufiddine 1 Chercher 1 \n13 AHAMADI OUSSENI Ansufiddine 2 Calculer 2 \n14 AHAMADI OUSSENI Ansufiddine . Calculer 2.c \n15 AHAMED Fayadhi 3 Chercher 1 \n16 AHAMED Fayadhi 2 Calculer 2 \n17 AHAMED Fayadhi 0 Calculer 2.c \n18 AHMED SAID Hadaïta 2 Chercher 1 \n19 AHMED SAID Hadaïta 2 Calculer 2 \n20 AHMED SAID Hadaïta 2 Calculer 2.c \n21 ALI Raydel 2 Chercher 1 \n22 ALI Raydel 0 Calculer 2 \n23 ALI Raydel 2 Calculer 2.c \n24 ALI MADI Anissa 3 Chercher 1 \n25 ALI MADI Anissa 1 Calculer 2 \n26 ALI MADI Anissa 0 Calculer 2.c \n27 ATTOUMANE ALI Fatima 1 Chercher 1 \n28 ATTOUMANE ALI Fatima 2 Calculer 2 \n29 ATTOUMANE ALI Fatima 0 Calculer 2.c \n... ... ... ... ... ... \n3922 MOHAMED Nadia . Chercher \n3923 MOHAMED Nadia . Chercher \n3924 MOHAMED Nadia . Raisonner \n3925 MOHAMED Nadia . Calculer \n3926 MOHAMED Nadia . Communiquer \n3927 MOUHOUDHOIRE Izak 0 Chercher \n3928 MOUHOUDHOIRE Izak . Chercher \n3929 MOUHOUDHOIRE Izak . Raisonner \n3930 MOUHOUDHOIRE Izak . Calculer \n3931 MOUHOUDHOIRE Izak . Communiquer \n3932 MOUSSRI Bakari 3 Chercher \n3933 MOUSSRI Bakari 1 Chercher \n3934 MOUSSRI Bakari 1 Raisonner \n3935 MOUSSRI Bakari 1 Calculer \n3936 MOUSSRI Bakari 1 Communiquer \n3937 SAKOTRA Claudiana . Chercher \n3938 SAKOTRA Claudiana . Chercher \n3939 SAKOTRA Claudiana . Raisonner \n3940 SAKOTRA Claudiana . Calculer \n3941 SAKOTRA Claudiana 1 Communiquer \n3942 SAÏD Fatoumia 3 Chercher \n3943 SAÏD Fatoumia 3 Chercher \n3944 SAÏD Fatoumia 3 Raisonner \n3945 SAÏD Fatoumia 2 Calculer \n3946 SAÏD Fatoumia 2 Communiquer \n3947 TOUFAIL Salahou 3 Chercher \n3948
]
2017-09-06 12:23:16 +00:00
}
],
"source": [
2017-09-10 15:41:11 +00:00
"report_comp.head(questions_scores)"
2017-09-06 12:23:16 +00:00
]
},
{
2017-09-10 15:41:11 +00:00
"cell_type": "markdown",
2017-09-06 12:23:16 +00:00
"metadata": {},
"source": [
2017-09-10 15:41:11 +00:00
"Heapmap des competences et des élèves"
2017-09-06 12:23:16 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
2017-09-10 15:41:11 +00:00
"metadata": {},
2017-09-06 12:23:16 +00:00
"outputs": [],
2017-09-10 15:41:11 +00:00
"source": [
"plt.figure(figsize=(10, 10))\n",
"ax = sns.heatmap(report_comp, cmap='YlOrRd', linewidths=.5)\n",
"ax.tick_params(labelbottom='on',labeltop='on')"
]
2017-09-06 12:23:16 +00:00
}
],
"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.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}