Removed rapport and period mean from plot data

This commit is contained in:
Eljakim Herrewijnen 2021-09-20 22:39:36 +02:00
parent 95856aee0b
commit f55f925bdf
6 changed files with 50 additions and 14 deletions

View File

@ -1,9 +1,19 @@
from flask import Flask, render_template
app = Flask("Project Numeri")
from plots import Cijferlijst
import base64
cf = Cijferlijst()
import matplotlib.pyplot as plt
@app.route('/')
def index():
return render_template('index.html')
data = cf.GetSubjectByYear("godsdienst", "2010/2011")
x = data['Datum invoer(Voortgangsdossier)']
y = data['Cijfer(Voortgangsdossier)']
plt.plot(x,y)
return render_template('index.html', title="joe", imgdata=None)
def RunWeb():
app.run(debug=True)

23
main.py
View File

@ -1,9 +1,30 @@
from flaskapp import *
from plots import Cijferlijst
import matplotlib.pyplot as plt
from datetime import datetime
import matplotlib.dates as mdates
if __name__ == "__main__":
cf = Cijferlijst()
data = cf.GetSubjectByYear("godsdienst", "2010/2011")
cf.CalculateMedian()
#Get dates and convert them to actual dates
x = data['Datum invoer(Voortgangsdossier)']
x = [datetime.strptime(date, "%d-%m-%Y") for date in x]
y = data['Cijfer(Voortgangsdossier)']
y = [float(line.replace(",", ".")) for line in y]
# p = plt.scatter(x,y)
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m/%d/%Y'))
# plt.gca().xaxis.set_major_locator(mdates.DayLocator())
plt.scatter(x,y)
plt.gcf().autofmt_xdate()
# plt.show()
# plt.plot(range(5))
# plt.xlim(0, 10)
# plt.ylim(0, 10)
# cf.CalculateMedian()
RunWeb()

View File

@ -14,10 +14,17 @@ class Cijferlijst:
'''
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]
select_year = self.ps[self.ps['Schooljaar(Voortgangsdossier)'] == year]
select_subject = select_year[select_year["Vak(Voortgangsdossier)"] == subject]
#filter period and rapport
rapports = select_subject[select_subject['Cijfertype(Voortgangsdossier)'] != "Periodegemiddelde"]
return rapports[rapports ['Cijfertype(Voortgangsdossier)'] != "Rapportcijfer"]
else:
return False
def iets(self):
print(self.grade_list)

2
static/jquery-3.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

0
static/style.css Normal file
View File

View File

@ -2,16 +2,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<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/style.css">
<link rel="stylesheet" href="style.css">
<script>"jquery-3.6.0.min.js"</script>
</head>
<body>
{% block body %}{% endblock %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
{% block scripts %}{% endblock %}
</body>
<h1>{{title}}</h1>
<img src="data:image/png;base64,{house.image}" alt="img_data" id="imgslot"/>
</body>
</html>