Last active
August 26, 2021 21:29
-
-
Save khuyentran1401/0d19253ff41bf68addf933a74e40ad13 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 numpy as np | |
def get_average_friends_of_a_person_friends(data: pd.DataFrame, person_id): | |
"""Get the average number of friends a person's friends have""" | |
num_friends_map = get_num_friends_map(friends) | |
num_friends_of_friends = get_num_friends_of_a_person_friends( | |
data, person_id, num_friends_map | |
) | |
return np.mean(num_friends_of_friends) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment