Able to get data from a subject with a period
This commit is contained in:
parent
f8c06a239e
commit
95856aee0b
2
main.py
2
main.py
@ -1,7 +1,9 @@
|
||||
from flaskapp import *
|
||||
from plots import Cijferlijst
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
if __name__ == "__main__":
|
||||
cf = Cijferlijst()
|
||||
data = cf.GetSubjectByYear("godsdienst", "2010/2011")
|
||||
cf.CalculateMedian()
|
||||
RunWeb()
|
11
plots.py
11
plots.py
@ -8,6 +8,17 @@ class Cijferlijst:
|
||||
self.grade_list = grade_list
|
||||
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):
|
||||
print(self.grade_list)
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<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/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>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user