-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepartment_names.py
32 lines (27 loc) · 1008 Bytes
/
department_names.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
32
from parse import major_codes, major_plans
from_plans = sorted(set(major.department for major in major_plans(2021).values()))
from_codes = sorted(set(major.department for major in major_codes().values()))
print("PLANS CODES")
i = 0
j = 0
while i < len(from_plans) and j < len(from_codes):
if from_plans[i] == from_codes[j]:
department = from_plans[i] or "_"
# https://stackoverflow.com/a/5676884
print(f"{department: <5} {department: <5}")
i += 1
j += 1
elif from_plans[i] < from_codes[j]:
print(f"{from_plans[i] or '_': <5} ")
i += 1
else:
print(f" {from_codes[j] or '_': <5}")
j += 1
for dept in from_plans[i:]:
print(f"{dept: <5} ")
for dept in from_codes[j:]:
print(f" {dept: <5}")
# Seems that isis_major_code_list.xlsx has more departments than
# academic_plans.csv, which makes sense
print(from_plans)
print(sorted(set(major.major_code[0:2] for major in major_plans(2021).values())))