repytex/notes_tools/tools/term_tools.py

40 lines
976 B
Python

#!/usr/bin/env python
# encoding: utf-8
import pandas as pd
import numpy as np
def select(quest_df, exo_df, eval_df, term):
""" 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["Trimestre"] == term]
exo = exo_df[exo_df["Trimestre"] == term]
ev = eval_df[eval_df["Trimestre"] == term]
return qu, exo, ev
def students_pov(quest_df, exo_df, eval_df):
es = []
for e in eval_df["Eleve"].unique():
eleve = {"Nom":e}
e_quest = quest_df[quest_df["Eleve"] == e]
eleve["quest"] = e_quest
e_exo = exo_df[exo_df["Eleve"] == e]
eleve["exo"] = e_exo
e_eval = eval_df[eval_df["Eleve"] == e]
eleve["eval"] = e_eval
es.append(eleve)
return es
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del