-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtutorial.py
More file actions
28 lines (15 loc) · 760 Bytes
/
Copy pathtutorial.py
File metadata and controls
28 lines (15 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pandas as pd
from student import Student
def get_tutorial(student, day):
open_teachers = []
data = "School.csv"
df = pd.read_csv(data) #reads csv into dataframe
df.set_index("Name", inplace=True) #Makes name attribute the way to index rows
"""Loops Through every period in classes dictionary.
Gets name of each teacher. Indexes that row and column for day passed in.
Checks if that slot is open, and if so adds it as an open teacher"""
for period, room in student.classes.items():
for teacher in room:
if str(df.loc[teacher].loc[day]) == "open": #gets teacher and day slot in csv and checks whether open or not
open_teachers.append(teacher)
return open_teachers