{
"cells": [
{
"cell_type": "code",
"execution_count": 168,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd\n",
"from opytex import texenv\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"plt.style.use(\"seaborn-notebook\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Information sur la classe"
]
},
{
"cell_type": "code",
"execution_count": 169,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"classe = \"309\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import et premiers traitements"
]
},
{
"cell_type": "code",
"execution_count": 171,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"['notes',\n",
" 'Remarques',\n",
" 'Conn',\n",
" 'DM_15_09_18',\n",
" 'DS_15_09_25',\n",
" 'pyramide',\n",
" 'BB_15_10_31',\n",
" 'DS_15_11_27',\n",
" 'DM_15_12_09',\n",
" 'Boulettes',\n",
" 'BB_16_01_23',\n",
" 'DM_16_01_29',\n",
" 'BB_16_02_15',\n",
" 'DM_16_03_30',\n",
" 'BB_16_04_02',\n",
" 'BB_16_04_19',\n",
" 'DM_16_05_18',\n",
" 'BB_16_06_03']"
]
},
"execution_count": 171,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"all_notes = pd.ExcelFile(\"../../../notes/\"+classe+\".xlsx\")\n",
"all_notes.sheet_names"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Bilan 3e trimestre"
]
},
{
"cell_type": "code",
"execution_count": 173,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ds_name = \"notes\"\n",
"notes = all_notes.parse(ds_name)"
]
},
{
"cell_type": "code",
"execution_count": 174,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"Index(['DM_16_03_30', 'BB_16_04_02', 'BB_16_04_19', 'DM_16_05_18',\n",
" 'BB_16_06_03', 'Conn trimestre 3'],\n",
" dtype='object')"
]
},
"execution_count": 174,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"notes[17:].index"
]
},
{
"cell_type": "code",
"execution_count": 175,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"trim3 = notes[17:]"
]
},
{
"cell_type": "code",
"execution_count": 176,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"trim3.index = [\"DM 4\", \"BB avril\", \"BB commun\", \"DM 5\", \"BB mai\", \"Connaissances\"]\n",
"trim3 = trim3.T"
]
},
{
"cell_type": "code",
"execution_count": 179,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"barem = trim3[:1]\n",
"notesT3 = trim3[1:31]"
]
},
{
"cell_type": "code",
"execution_count": 180,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"notesT3 = notesT3.dropna()"
]
},
{
"cell_type": "code",
"execution_count": 182,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/lib/python3.5/site-packages/ipykernel/__main__.py:1: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
" if __name__ == '__main__':\n"
]
}
],
"source": [
"barem.loc[\"Coefficient\"] = [0.5, 1, 1, 0.5, 1, 1]"
]
},
{
"cell_type": "code",
"execution_count": 183,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"DM 4 0.5\n",
"BB avril 1.0\n",
"BB commun 1.0\n",
"DM 5 0.5\n",
"BB mai 1.0\n",
"Connaissances 1.0\n",
"Name: Coefficient, dtype: float64"
]
},
"execution_count": 183,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"barem.loc[\"Coefficient\"]"
]
},
{
"cell_type": "code",
"execution_count": 184,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"
\n",
" \n",
" \n",
" | \n",
" DM 4 | \n",
" BB avril | \n",
" BB commun | \n",
" DM 5 | \n",
" BB mai | \n",
" Connaissances | \n",
"
\n",
" \n",
" \n",
" \n",
" ABDOU Farida | \n",
" 10.0 | \n",
" 8.5 | \n",
" 17.5 | \n",
" 0.0 | \n",
" 16.5 | \n",
" 11.5 | \n",
"
\n",
" \n",
" ABOU BACAR Djaha | \n",
" 10.0 | \n",
" 11.5 | \n",
" 15.5 | \n",
" 11.0 | \n",
" 11.5 | \n",
" 14.5 | \n",
"
\n",
" \n",
" AHAMADA Nabaouya | \n",
" 13.0 | \n",
" 11.5 | \n",
" 14.0 | \n",
" 13.0 | \n",
" 14.5 | \n",
" 8.0 | \n",
"
\n",
" \n",
" AHAMADI Faina | \n",
" 14.0 | \n",
" 7.5 | \n",
" 7.0 | \n",
" 14.0 | \n",
" 7.5 | \n",
" 10.5 | \n",
"
\n",
" \n",
" ALI Mardhuia | \n",
" 9.5 | \n",
" 14.5 | \n",
" 28.0 | \n",
" 11.0 | \n",
" 20.5 | \n",
" 11.0 | \n",
"
\n",
" \n",
" ALI SOULAIMANA Chamsia | \n",
" 16.5 | \n",
" 14.5 | \n",
" 16.5 | \n",
" 11.5 | \n",
" 15.5 | \n",
" 13.5 | \n",
"
\n",
" \n",
" ALSENE ALI MADI Stela | \n",
" 5.0 | \n",
" 10.5 | \n",
" 9.5 | \n",
" 13.0 | \n",
" 7.5 | \n",
" 3.5 | \n",
"
\n",
" \n",
" ANDRIATAHIANA Hoby | \n",
" 13.5 | \n",
" 17.0 | \n",
" 15.0 | \n",
" 17.5 | \n",
" 19.5 | \n",
" 13.5 | \n",
"
\n",
" \n",
" ANLI Emeline | \n",
" 8.0 | \n",
" 11.5 | \n",
" 0.0 | \n",
" 10.0 | \n",
" 12.0 | \n",
" 10.5 | \n",
"
\n",
" \n",
" ATHOUMANE Naouidat | \n",
" 11.5 | \n",
" 10.5 | \n",
" 14.0 | \n",
" 12.5 | \n",
" 11.0 | \n",
" 11.5 | \n",
"
\n",
" \n",
" BOUDRA Nassifanya | \n",
" 16.5 | \n",
" 20.5 | \n",
" 18.5 | \n",
" 15.5 | \n",
" 15.5 | \n",
" 18.0 | \n",
"
\n",
" \n",
" CHANFI Nadhrati | \n",
" 16.0 | \n",
" 10.5 | \n",
" 5.0 | \n",
" 10.0 | \n",
" 9.0 | \n",
" 2.5 | \n",
"
\n",
" \n",
" COMBO Moinécha | \n",
" 18.5 | \n",
" 17.0 | \n",
" 25.5 | \n",
" 17.5 | \n",
" 21.5 | \n",
" 15.5 | \n",
"
\n",
" \n",
" HALIDI Nisma | \n",
" 15.0 | \n",
" 18.5 | \n",
" 25.0 | \n",
" 14.5 | \n",
" 19.0 | \n",
" 15.0 | \n",
"
\n",
" \n",
" HAMZA Samianti | \n",
" 10.5 | \n",
" 9.0 | \n",
" 8.0 | \n",
" 10.0 | \n",
" 9.0 | \n",
" 8.5 | \n",
"
\n",
" \n",
" HOUMADI Mouslimati | \n",
" 0.0 | \n",
" 0.0 | \n",
" 15.0 | \n",
" 3.5 | \n",
" 16.5 | \n",
" 8.0 | \n",
"
\n",
" \n",
" HOUMADI Chaharazadi | \n",
" 16.0 | \n",
" 15.5 | \n",
" 15.5 | \n",
" 14.5 | \n",
" 20.0 | \n",
" 14.0 | \n",
"
\n",
" \n",
" HOUMADI Nasmi | \n",
" 19.0 | \n",
" 17.0 | \n",
" 12.0 | \n",
" 16.5 | \n",
" 16.5 | \n",
" 17.0 | \n",
"
\n",
" \n",
" HOUMADI Dhoirfia | \n",
" 18.5 | \n",
" 12.5 | \n",
" 14.0 | \n",
" 16.5 | \n",
" 9.5 | \n",
" 15.0 | \n",
"
\n",
" \n",
" LOUTOUFI Nachima | \n",
" 7.0 | \n",
" 11.0 | \n",
" 16.5 | \n",
" 10.5 | \n",
" 13.5 | \n",
" 10.0 | \n",
"
\n",
" \n",
" MALIDE El-Anzize | \n",
" 15.5 | \n",
" 10.5 | \n",
" 10.5 | \n",
" 12.0 | \n",
" 7.5 | \n",
" 16.5 | \n",
"
\n",
" \n",
" MONNE Kevin | \n",
" 7.0 | \n",
" 14.5 | \n",
" 20.0 | \n",
" 0.0 | \n",
" 19.5 | \n",
" 11.0 | \n",
"
\n",
" \n",
" MOUSSA Roibouanti | \n",
" 17.5 | \n",
" 21.0 | \n",
" 23.0 | \n",
" 18.5 | \n",
" 19.0 | \n",
" 16.0 | \n",
"
\n",
" \n",
" OUSSENI Hilma | \n",
" 17.5 | \n",
" 13.5 | \n",
" 15.0 | \n",
" 16.5 | \n",
" 11.0 | \n",
" 13.5 | \n",
"
\n",
" \n",
" SAANLI Natali | \n",
" 19.0 | \n",
" 20.0 | \n",
" 30.0 | \n",
" 17.5 | \n",
" 25.5 | \n",
" 19.0 | \n",
"
\n",
" \n",
" SAID AHAMADA Roukaya | \n",
" 15.5 | \n",
" 13.0 | \n",
" 17.5 | \n",
" 13.0 | \n",
" 19.5 | \n",
" 15.5 | \n",
"
\n",
" \n",
" SANDA Issoufi | \n",
" 15.0 | \n",
" 13.5 | \n",
" 15.0 | \n",
" 16.0 | \n",
" 12.5 | \n",
" 8.5 | \n",
"
\n",
" \n",
" SOILIHI Soifia | \n",
" 14.5 | \n",
" 13.5 | \n",
" 14.5 | \n",
" 10.5 | \n",
" 13.0 | \n",
" 11.0 | \n",
"
\n",
" \n",
" SOUFIANI Laila | \n",
" 2.0 | \n",
" 5.5 | \n",
" 5.0 | \n",
" 0.0 | \n",
" 7.5 | \n",
" 4.0 | \n",
"
\n",
" \n",
" YOUSSOUF Sitirati | \n",
" 6.5 | \n",
" 11.5 | \n",
" 5.0 | \n",
" 0.0 | \n",
" 10.5 | \n",
" 6.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" DM 4 BB avril BB commun DM 5 BB mai Connaissances\n",
"ABDOU Farida 10.0 8.5 17.5 0.0 16.5 11.5\n",
"ABOU BACAR Djaha 10.0 11.5 15.5 11.0 11.5 14.5\n",
"AHAMADA Nabaouya 13.0 11.5 14.0 13.0 14.5 8.0\n",
"AHAMADI Faina 14.0 7.5 7.0 14.0 7.5 10.5\n",
"ALI Mardhuia 9.5 14.5 28.0 11.0 20.5 11.0\n",
"ALI SOULAIMANA Chamsia 16.5 14.5 16.5 11.5 15.5 13.5\n",
"ALSENE ALI MADI Stela 5.0 10.5 9.5 13.0 7.5 3.5\n",
"ANDRIATAHIANA Hoby 13.5 17.0 15.0 17.5 19.5 13.5\n",
"ANLI Emeline 8.0 11.5 0.0 10.0 12.0 10.5\n",
"ATHOUMANE Naouidat 11.5 10.5 14.0 12.5 11.0 11.5\n",
"BOUDRA Nassifanya 16.5 20.5 18.5 15.5 15.5 18.0\n",
"CHANFI Nadhrati 16.0 10.5 5.0 10.0 9.0 2.5\n",
"COMBO Moinécha 18.5 17.0 25.5 17.5 21.5 15.5\n",
"HALIDI Nisma 15.0 18.5 25.0 14.5 19.0 15.0\n",
"HAMZA Samianti 10.5 9.0 8.0 10.0 9.0 8.5\n",
"HOUMADI Mouslimati 0.0 0.0 15.0 3.5 16.5 8.0\n",
"HOUMADI Chaharazadi 16.0 15.5 15.5 14.5 20.0 14.0\n",
"HOUMADI Nasmi 19.0 17.0 12.0 16.5 16.5 17.0\n",
"HOUMADI Dhoirfia 18.5 12.5 14.0 16.5 9.5 15.0\n",
"LOUTOUFI Nachima 7.0 11.0 16.5 10.5 13.5 10.0\n",
"MALIDE El-Anzize 15.5 10.5 10.5 12.0 7.5 16.5\n",
"MONNE Kevin 7.0 14.5 20.0 0.0 19.5 11.0\n",
"MOUSSA Roibouanti 17.5 21.0 23.0 18.5 19.0 16.0\n",
"OUSSENI Hilma 17.5 13.5 15.0 16.5 11.0 13.5\n",
"SAANLI Natali 19.0 20.0 30.0 17.5 25.5 19.0\n",
"SAID AHAMADA Roukaya 15.5 13.0 17.5 13.0 19.5 15.5\n",
"SANDA Issoufi 15.0 13.5 15.0 16.0 12.5 8.5\n",
"SOILIHI Soifia 14.5 13.5 14.5 10.5 13.0 11.0\n",
"SOUFIANI Laila 2.0 5.5 5.0 0.0 7.5 4.0\n",
"YOUSSOUF Sitirati 6.5 11.5 5.0 0.0 10.5 6.0"
]
},
"execution_count": 184,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"notesT3"
]
},
{
"cell_type": "code",
"execution_count": 185,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"
\n",
" \n",
" \n",
" | \n",
" DM 4 | \n",
" BB avril | \n",
" BB commun | \n",
" DM 5 | \n",
" BB mai | \n",
" Connaissances | \n",
"
\n",
" \n",
" \n",
" \n",
" ABDOU Farida | \n",
" 10.0 | \n",
" 5.5 | \n",
" 8.5 | \n",
" 0 | \n",
" 8.9 | \n",
" 11.5 | \n",
"
\n",
" \n",
" ABOU BACAR Djaha | \n",
" 10.0 | \n",
" 7.4 | \n",
" 7.6 | \n",
" 11 | \n",
" 6.2 | \n",
" 14.5 | \n",
"
\n",
" \n",
" AHAMADA Nabaouya | \n",
" 13.0 | \n",
" 7.4 | \n",
" 6.8 | \n",
" 13 | \n",
" 7.8 | \n",
" 8.0 | \n",
"
\n",
" \n",
" AHAMADI Faina | \n",
" 14.0 | \n",
" 4.8 | \n",
" 3.4 | \n",
" 14 | \n",
" 4.1 | \n",
" 10.5 | \n",
"
\n",
" \n",
" ALI Mardhuia | \n",
" 9.5 | \n",
" 9.4 | \n",
" 13.7 | \n",
" 11 | \n",
" 11.1 | \n",
" 11.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" DM 4 BB avril BB commun DM 5 BB mai Connaissances\n",
"ABDOU Farida 10.0 5.5 8.5 0 8.9 11.5\n",
"ABOU BACAR Djaha 10.0 7.4 7.6 11 6.2 14.5\n",
"AHAMADA Nabaouya 13.0 7.4 6.8 13 7.8 8.0\n",
"AHAMADI Faina 14.0 4.8 3.4 14 4.1 10.5\n",
"ALI Mardhuia 9.5 9.4 13.7 11 11.1 11.0"
]
},
"execution_count": 185,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"notes_20 = notesT3 / barem.values[0]*20\n",
"notes_20 = notes_20.astype(float).round(1)\n",
"notes_20.head()"
]
},
{
"cell_type": "code",
"execution_count": 186,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"save_tex = []\n",
"for i in notes_20.iterrows():\n",
" plop = pd.DataFrame({i[0]:i[1], \n",
" 'Coefficient': barem.loc[\"Coefficient\"]\n",
" })\n",
" save_tex.append(plop.T.to_latex())"
]
},
{
"cell_type": "code",
"execution_count": 187,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"head = r\"\"\" \n",
"\\documentclass[a4paper,10pt]{/media/documents/Cours/Prof/Enseignements/tools/style/classExo}\n",
"\\usepackage{/media/documents/Cours/Prof/Enseignements/2015_2016}\n",
"\n",
"% Title Page\n",
"\\titre{Généralités sur les fonctions - Exercices}\n",
"% \\seconde \\premiereS \\PSTMG \\TSTMG\n",
"\\classe{Troisième}\n",
"\\date{Mai 2016}\n",
"\n",
"\n",
"\\pagestyle{empty}\n",
"\n",
"\\begin{document}\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 188,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"foot = r\"\"\"\n",
"\n",
"\\end{document}\n",
"\n",
"%%% Local Variables: \n",
"%%% mode: latex\n",
"%%% TeX-master: \"master\"\n",
"%%% End:\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 189,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"with open(\"notes_\"+classe+\".tex\", \"w\") as f:\n",
" f.write(head)\n",
" f.write(\"\\n\\\\vspace{1cm}\".join(save_tex))\n",
" f.write(foot)"
]
},
{
"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.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}