44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
|
#!/usr/bin/env python
|
||
|
# encoding: utf-8
|
||
|
|
||
|
import pandas as pd
|
||
|
import numpy as np
|
||
|
|
||
|
|
||
|
def select_eval(quest_df, exo_df, eval_df, evalname):
|
||
|
""" Return quest, exo and eval rows which correspond to evalname
|
||
|
|
||
|
:param quest_df: TODO
|
||
|
:param exo_df: TODO
|
||
|
:param eval_df: TODO
|
||
|
|
||
|
"""
|
||
|
qu = quest_df[quest_df["Nom"] == evalname]
|
||
|
exo = exo_df[exo_df["Nom"] == evalname]
|
||
|
ev = eval_df[eval_df["Nom"] == evalname]
|
||
|
return qu, exo, ev
|
||
|
|
||
|
def get_present_absent(eval_df):
|
||
|
""" Return list of student who where present (Mark > 0) and
|
||
|
the list of those who weren't
|
||
|
|
||
|
"""
|
||
|
presents = eval_df[eval_df["Mark"] > 0]["Eleve"]
|
||
|
absents = eval_df[eval_df["Mark"] == 0]["Eleve"]
|
||
|
return {"presents": presents, "absents": absents}
|
||
|
|
||
|
def keep_only_presents(quest_df, exo_df, eval_df, presents):
|
||
|
""" Return quest, exo and eval rows of presents students """
|
||
|
qu = quest_df[quest_df["Eleve"].isin(presents)]
|
||
|
exo = exo_df[exo_df["Eleve"].isin(presents)]
|
||
|
ev = eval_df[eval_df["Eleve"].isin(presents)]
|
||
|
return qu, exo, ev
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
# -----------------------------
|
||
|
# Reglages pour 'vim'
|
||
|
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
|
||
|
# cursor: 16 del
|