From 873184fcb5f5e7fcb173e7c53656e0577b977f2b Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Tue, 21 Mar 2017 20:35:38 +0300 Subject: [PATCH] Handle null bareme in note_to_level --- notes_tools/tools/df_marks_manip.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/notes_tools/tools/df_marks_manip.py b/notes_tools/tools/df_marks_manip.py index 845bddd..eb3b193 100644 --- a/notes_tools/tools/df_marks_manip.py +++ b/notes_tools/tools/df_marks_manip.py @@ -116,6 +116,9 @@ def note_to_level(x): if pd.isnull(x["Note"]): return "na" + if pd.isnull(x["Bareme"]) or x["Bareme"] == 0: + return "na" + if x["Niveau"]: return int(x["Note"]) else: