Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comprehension Calculations - Jackson #44

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zcapjdb
Copy link

@zcapjdb zcapjdb commented Oct 23, 2020

Used list comprehensions to calculate a variety of information from our dictionary.

Answers UCL-RITS/rse-classwork-2020#10

Comment on lines +20 to +23
max_age = max([my_group[key]["age"] for key in my_group.keys()])
mean_relations = sum([len(my_group[key]['Aquaintances'].values()) for key in my_group.keys()]) / len(my_group.keys())
max_age_relations = max([my_group[key]["age"] for key in my_group.keys() if my_group[key]['Aquaintances'].values()])
max_age_friend = max([my_group[key]["age"] for key in my_group.keys() if "Friend" in my_group[key]['Aquaintances'].values()])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants