Last active
April 2, 2023 15:03
-
-
Save ErikBoesen/0f0a0ba584e9bddb3f7271713f8154e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yalies | |
import os | |
api = yalies.API(os.environ['YALIES_API_KEY']) | |
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | |
people = api.people(filters={'school_code': 'YC'}) | |
birth_months = [0] * 12 | |
for person in people: | |
birth_month = person.birth_month | |
if not birth_month: | |
continue | |
birth_months[birth_month - 1] += 1 | |
for month, births in zip(months, birth_months): | |
print(f'{month}: {births}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results:
Jan: 614
Feb: 526
Mar: 581
Apr: 506
May: 535
Jun: 495
Jul: 477
Aug: 483
Sep: 516
Oct: 571
Nov: 523
Dec: 559