Created
July 11, 2019 15:37
-
-
Save md2perpe/a61a1c892187a4a4d0bbc353b43c582c to your computer and use it in GitHub Desktop.
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 load_graph(): | |
g = {} | |
with open('sample.txt', 'r') as f: | |
for line in filter(lambda l: l != '\n', f): | |
row = line.split('\t') | |
g[int(row[1])] = list(map(int, row[2:])) | |
return g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment