Skip to content

Instantly share code, notes, and snippets.

@davisvictorns
Created September 15, 2021 01:27
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 davisvictorns/6e22dac1325eb931e2c49854ce4fa789 to your computer and use it in GitHub Desktop.
Save davisvictorns/6e22dac1325eb931e2c49854ce4fa789 to your computer and use it in GitHub Desktop.
edges = []
nodes = []
for i, row in df.iterrows():
curr_hashtags = row['hashtags'].split(' ')
nodes += curr_hashtags
combinations = list(itertools.combinations(curr_hashtags, 2))
edges += combinations
nodes_unique = set(nodes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment