Able to get data from a subject with a period

This commit is contained in:
Eljakim Herrewijnen 2021-09-18 13:21:17 +02:00
parent f8c06a239e
commit 95856aee0b
3 changed files with 14 additions and 1 deletions

View File

@ -1,7 +1,9 @@
from flaskapp import * from flaskapp import *
from plots import Cijferlijst from plots import Cijferlijst
import matplotlib.pyplot as plt
if __name__ == "__main__": if __name__ == "__main__":
cf = Cijferlijst() cf = Cijferlijst()
data = cf.GetSubjectByYear("godsdienst", "2010/2011")
cf.CalculateMedian() cf.CalculateMedian()
RunWeb() RunWeb()

View File

@ -8,6 +8,17 @@ class Cijferlijst:
self.grade_list = grade_list self.grade_list = grade_list
self.ps = pd.read_csv(GRADE_LIST, skiprows=2, sep=';') self.ps = pd.read_csv(GRADE_LIST, skiprows=2, sep=';')
'''
Get all data from a subject and a (yearly) period:
GetSubjectByYear("godsdienst", "2010/2011")
'''
def GetSubjectByYear(self, subject, year):
if(type(subject) == str and type(year) == str):
select_year = self.ps[self.ps['Schooljaar(Voortgangsdossier)'] == year]
return select_year[select_year["Vak(Voortgangsdossier)"] == subject]
else:
return False
def iets(self): def iets(self):
print(self.grade_list) print(self.grade_list)

View File

@ -6,7 +6,7 @@
<meta name="Anthony Federico" content="Flaskex"> <meta name="Anthony Federico" content="Flaskex">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../static/css/style.css"> <link rel="stylesheet" href="../static/style.css">
</head> </head>
<body> <body>
{% block body %}{% endblock %} {% block body %}{% endblock %}