Skip to content

Instantly share code, notes, and snippets.

@ErikBoesen
Last active April 2, 2023 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErikBoesen/0f0a0ba584e9bddb3f7271713f8154e7 to your computer and use it in GitHub Desktop.
Save ErikBoesen/0f0a0ba584e9bddb3f7271713f8154e7 to your computer and use it in GitHub Desktop.
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}')
@ErikBoesen
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment