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

Fixing code that tries to get index of an integer. #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scratch/introduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ def data_scientists_who_like(target_interest):
for user_id, interest in interests:
interests_by_user_id[user_id].append(interest)

def most_common_interests_with(user):
def most_common_interests_with(target_user):
user = users[target_user]["id"]
return Counter(
interested_user_id
for interest in interests_by_user_id[user["id"]]
for interest in interests_by_user_id[user]
for interested_user_id in user_ids_by_interest[interest]
if interested_user_id != user["id"]
if interested_user_id != user
)

salaries_and_tenures = [(83000, 8.7), (88000, 8.1),
Expand Down