forked from cheerstopaula/Allocation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_utils2.py
31 lines (28 loc) · 1.1 KB
/
data_utils2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pandas as pd
class Schedule:
def __init__(self,filename):
'''
Object Schedule has 6 attributes, inherited from the excel file with the schedule, as lists:
- subjects, - catalog, - capacity, - section, - days, - slot.
'''
attributes=self.build_atributes(filename)
self.subjects=attributes[0]
self.catalog=attributes[1]
self.capacity=attributes[2]
self.section=attributes[3]
self.days=attributes[4]
self.slot=attributes[5]
self.component=attributes[6]
def build_atributes(self, filename):
'''
Build, from excel file, all 6 Schedule atributes
'''
classes = pd.read_excel(filename)
subjects=classes['Subject'].to_list()
catalog=classes['Catalog'].to_list()
capacity=classes['Enrl Capacity'].to_list()
section=classes['Section'].to_list()
days=classes['zc.days'].to_list()
slot=classes['Mtg Time'].to_list()
component=classes['Component'].to_list()
return subjects, catalog, capacity, section, days, slot, component