From 59cd8e2aba2a599e57c9807c515e6e898e68645d Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Thu, 23 Mar 2017 09:08:47 +0300 Subject: [PATCH] add heatmap plot for term report --- notes_tools/tools/term_tools.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/notes_tools/tools/term_tools.py b/notes_tools/tools/term_tools.py index 1333a76..7dd984e 100644 --- a/notes_tools/tools/term_tools.py +++ b/notes_tools/tools/term_tools.py @@ -8,6 +8,8 @@ from notes_tools.tools.marks_plottings import (pie_pivot_table, radar_on, ) +import seaborn as sns + __all__ = ["students_pov", "class_pov"] class Student(object): @@ -98,6 +100,22 @@ class Student(object): "Domaine") return self._radar_on_domaine + @property + def heatmap_on_domain(self): + """ Heatmap over evals on domains """ + try: + self._heatmap_on_domain + except AttributeError: + comp = pd.pivot_table(self.quest_df, + index = "Competence", + columns = ["Date","Nom"], + values = ["Normalized"], + aggfunc = np.mean, + ) + comp.columns = [i[1].strftime("%Y-%m-%d") + "\n" + i[2] for i in comp.columns] + self._heatmap_on_domain = sns.heatmap(comp) + return self._heatmap_on_domain + def parallel_on_evals(self, classe_evals): """ Parallel coordinate plot of the class with student line highlight """