{ "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DM 4BB avrilBB communDM 5BB maiConnaissances
ABDOU Farida10.08.517.50.016.511.5
ABOU BACAR Djaha10.011.515.511.011.514.5
AHAMADA Nabaouya13.011.514.013.014.58.0
AHAMADI Faina14.07.57.014.07.510.5
ALI Mardhuia9.514.528.011.020.511.0
ALI SOULAIMANA Chamsia16.514.516.511.515.513.5
ALSENE ALI MADI Stela5.010.59.513.07.53.5
ANDRIATAHIANA Hoby13.517.015.017.519.513.5
ANLI Emeline8.011.50.010.012.010.5
ATHOUMANE Naouidat11.510.514.012.511.011.5
BOUDRA Nassifanya16.520.518.515.515.518.0
CHANFI Nadhrati16.010.55.010.09.02.5
COMBO Moinécha18.517.025.517.521.515.5
HALIDI Nisma15.018.525.014.519.015.0
HAMZA Samianti10.59.08.010.09.08.5
HOUMADI Mouslimati0.00.015.03.516.58.0
HOUMADI Chaharazadi16.015.515.514.520.014.0
HOUMADI Nasmi19.017.012.016.516.517.0
HOUMADI Dhoirfia18.512.514.016.59.515.0
LOUTOUFI Nachima7.011.016.510.513.510.0
MALIDE El-Anzize15.510.510.512.07.516.5
MONNE Kevin7.014.520.00.019.511.0
MOUSSA Roibouanti17.521.023.018.519.016.0
OUSSENI Hilma17.513.515.016.511.013.5
SAANLI Natali19.020.030.017.525.519.0
SAID AHAMADA Roukaya15.513.017.513.019.515.5
SANDA Issoufi15.013.515.016.012.58.5
SOILIHI Soifia14.513.514.510.513.011.0
SOUFIANI Laila2.05.55.00.07.54.0
YOUSSOUF Sitirati6.511.55.00.010.56.0
\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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DM 4BB avrilBB communDM 5BB maiConnaissances
ABDOU Farida10.05.58.508.911.5
ABOU BACAR Djaha10.07.47.6116.214.5
AHAMADA Nabaouya13.07.46.8137.88.0
AHAMADI Faina14.04.83.4144.110.5
ALI Mardhuia9.59.413.71111.111.0
\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 }