Skip to content

Instantly share code, notes, and snippets.

@khuyentran1401
Created August 27, 2021 02:33
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 khuyentran1401/7d5a18c5c9515e8ec6aa240d00e009e0 to your computer and use it in GitHub Desktop.
Save khuyentran1401/7d5a18c5c9515e8ec6aa240d00e009e0 to your computer and use it in GitHub Desktop.
# Define influencers
influencers = num_friends[
num_friends["friends_have_more_friends"] == False
].person_id.tolist()
# Mark the influencers red
net.nodes = [
{"id": node["id"], "label": node["id"], "shape": "dot", "color": "#eb4034"}
if node["id"] in influencers
else node
for node in net.nodes
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment