Feat: add handling ppre

This commit is contained in:
Bertrand Benjamin 2021-04-18 09:57:53 +02:00
parent a0e94f52b1
commit 8f2ae96338
2 changed files with 4 additions and 7 deletions

View File

@ -192,7 +192,7 @@ def update_final_scores(data):
scores = pd.DataFrame.from_records(data)
try:
if scores.iloc[0]["Commentaire"] == "commentaire":
if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any():
scores.drop([0], inplace=True)
except KeyError:
pass
@ -280,7 +280,7 @@ def update_final_scores_hist(data):
def update_competence_fig(data):
scores = pd.DataFrame.from_records(data)
try:
if scores.iloc[0]["Commentaire"] == "commentaire":
if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any():
scores.drop([0], inplace=True)
except KeyError:
pass

View File

@ -191,11 +191,8 @@ def update_student_scores(tribe, student, term):
except pd.errors.ParserError:
pass
else:
try:
if scores.iloc[0]["Commentaire"] == "commentaire":
scores.drop([0], inplace=True)
except KeyError:
pass
if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any():
scores.drop([0], inplace=True)
scores = flat_df_students(scores).dropna(subset=["Score"])
scores = scores[scores["Eleve"] == student]
scores = scores[scores["Trimestre"] == term]