Skip to content

Instantly share code, notes, and snippets.

@paulgb
Created January 12, 2014 16:09
Show Gist options
  • Save paulgb/8386567 to your computer and use it in GitHub Desktop.
Save paulgb/8386567 to your computer and use it in GitHub Desktop.
friendset = set()
for line in open('input/soc-LiveJournal1Adj.txt'):
try:
user, friends = line.strip().split('\t')
except ValueError:
continue
for friend in friends.split(','):
friendset.add((user, friend))
for f1, f2 in friendset:
if (f2, f1) not in friendset:
print repr(f2), repr(f1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment