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
def twitter_network(users, api, user_type="search", alt_type="friend"): | |
""" | |
Given a list of Twitter users, create NetworkX object of relationships. | |
args: users List of Twitter users as strings | |
user_types Type string for entries in 'users' | |
""" | |
twitter_network=nx.DiGraph() | |
# Iteratively create network with appropriate type data | |
users=list(users) | |
for u in users: |