Add new scripts for processing exam groups and updating schedules; refactor existing code

This commit is contained in:
bdaneels
2025-07-25 11:14:58 +02:00
parent b912de4c44
commit c547a74bba
9 changed files with 678 additions and 38 deletions

View File

@@ -2,7 +2,7 @@ import pandas as pd
# Constants
FILE_PATH = 'file.xlsx'
SHEET_NAME = 'ps (32)'
SHEET_NAME = 'ps (53)'
OUTPUT_FILE_PATH = 'filtered_grote_lokalen.xlsx'
EXAM_FORM_COLUMN = 'Examenvorm'
REGISTRATION_COLUMN = 'Aant. inschr.'
@@ -10,6 +10,7 @@ BEGIN_TIME_COLUMN = 'Beginuur S+'
END_TIME_COLUMN = 'Einduur S+'
TEACHERS_COLUMN = 'Docenten'
LOCATION_COLUMNS = ['Datum S+', BEGIN_TIME_COLUMN, END_TIME_COLUMN, 'Studiegidsnr.', 'Omschrijving', TEACHERS_COLUMN, REGISTRATION_COLUMN]
AANTAL_STUDENTEN = 65
# Read the Excel file
def read_excel(file_path, sheet_name):
@@ -18,7 +19,7 @@ def read_excel(file_path, sheet_name):
# Filter DataFrame
def filter_dataframe(df):
df = df[df[EXAM_FORM_COLUMN] == 'Schriftelijk']
df = df[df[REGISTRATION_COLUMN] > 65]
df = df[df[REGISTRATION_COLUMN] > AANTAL_STUDENTEN]
return df[LOCATION_COLUMNS]
# Format time strings