From b607d64e3a25b91883558edd9fa63d9db8c8386b Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Fri, 31 Mar 2017 19:56:36 +0300 Subject: [PATCH] Add and correct pies --- notes_tools/tools/evaluation.py | 31 ++++++++++++++++++++----------- notes_tools/tools/term.py | 4 ++-- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/notes_tools/tools/evaluation.py b/notes_tools/tools/evaluation.py index e6a3a35..568ff0a 100644 --- a/notes_tools/tools/evaluation.py +++ b/notes_tools/tools/evaluation.py @@ -188,16 +188,6 @@ class Classe(object): self.exo_df = exo_df self.eval_df = eval_df - @property - def desription(self): - """ Desribe on marks """ - # TODO: not working... |ven. mars 31 18:48:17 EAT 2017 - try: - self._description - except AttributeError: - self._description = self.eval_df["Mark"].describe() - return self._description - @property def marks_tabular(self): """ Latex tabular with marks of students""" @@ -240,7 +230,7 @@ class Classe(object): return lines[1:] exercice_sep = lines_4_heatmap(pv.columns) - pv.columns = [f"{i[1]} {i[2]} {i[3]:.15}" for i in pv.columns.get_values()] + pv.columns = [f"{i[3]:.15} {i[1]} {i[2]}" for i in pv.columns.get_values()] self._level_heatmap = sns.heatmap(pv.T) @@ -251,6 +241,25 @@ class Classe(object): return self._level_heatmap + @property + def pies_eff_pts_on_competence(self): + """ Pie charts on competence with repartition of evaluated times and attributed points """ + return pie_pivot_table(self.quest_df[["Competence", "Bareme", "Exercice", "Question", "Commentaire"]].drop_duplicates(), + index = "Competence", + #columns = "Level", + values = "Bareme", + aggfunc=[len,np.sum], + fill_value=0) + + @property + def pies_eff_pts_on_domaine(self): + """ Pie charts on domaine with repartition of evaluated times and attributed points """ + return pie_pivot_table(self.quest_df[["Domaine", "Bareme", "Exercice", "Question", "Commentaire"]].drop_duplicates(), + index = "Domaine", + #columns = "Level", + values = "Bareme", + aggfunc=[len,np.sum], + fill_value=0) diff --git a/notes_tools/tools/term.py b/notes_tools/tools/term.py index 14a664a..378a017 100644 --- a/notes_tools/tools/term.py +++ b/notes_tools/tools/term.py @@ -157,7 +157,7 @@ class Classe(object): @property def pies_eff_pts_on_competence(self): """ Pie charts on competence with repartition of evaluated times and attributed points """ - return pie_pivot_table(self.quest_df, + return pie_pivot_table(self.quest_df[["Competence", "Bareme", "Exercice", "Question", "Commentaire"]].drop_duplicates(), index = "Competence", #columns = "Level", values = "Bareme", @@ -167,7 +167,7 @@ class Classe(object): @property def pies_eff_pts_on_domaine(self): """ Pie charts on domaine with repartition of evaluated times and attributed points """ - return pie_pivot_table(self.quest_df, + return pie_pivot_table(self.quest_df[["Domaine", "Bareme", "Exercice", "Question", "Commentaire"]].drop_duplicates(), index = "Domaine", #columns = "Level", values = "Bareme",