From 414f411ea5cd69aca190cf0aea62045f721cdcdc Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Sat, 26 Nov 2016 18:03:03 +0300 Subject: [PATCH] mod radar --- notes_tools/generate_bilan/texenv.py | 4 ++-- notes_tools/tools/marks_plottings.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/notes_tools/generate_bilan/texenv.py b/notes_tools/generate_bilan/texenv.py index 0a2459c..3a12299 100644 --- a/notes_tools/generate_bilan/texenv.py +++ b/notes_tools/generate_bilan/texenv.py @@ -31,8 +31,8 @@ texenv = jinja2.Environment( from .filters import includegraphics texenv.filters['includegraphics'] = includegraphics -from notes_tools.tools.marks_plottings import comp_radar, marks_hist -texenv.filters['comp_radar'] = comp_radar +from notes_tools.tools.marks_plottings import radar_on, marks_hist +texenv.filters['radar_on'] = radar_on texenv.filters['marks_hist'] = marks_hist def feed_template(target, datas, template): diff --git a/notes_tools/tools/marks_plottings.py b/notes_tools/tools/marks_plottings.py index 70930be..b8d6bec 100644 --- a/notes_tools/tools/marks_plottings.py +++ b/notes_tools/tools/marks_plottings.py @@ -5,15 +5,15 @@ from .plottings import radar_graph import pandas as pd import numpy as np -def comp_radar(df, optimum = None): - """ Plot the radar graph concerning "Competence" column of the df +def radar_on(df, index, optimum = None): + """ Plot the radar graph concerning index column of the df - :param df: DataFrame with "Competence", "Normalized" + :param df: DataFrame with index and "Normalized" column :returns: exes with radar plot """ comp_pt = pd.pivot_table(df, - index = ["Competence"], + index = [index], values = ["Normalized"], aggfunc=np.mean, )