Created
January 12, 2014 16:09
-
-
Save paulgb/8386567 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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