python - Convert a path to nodes and edges? -


i have tsv lots of paths in :

parts of looks this:

    14th_century;china;gunpowder;fire     14th_century;time;isaac_newton;light;color;rainbow           14th_century;15th_century;16th_century;pacific_ocean;atlantic_ocean;accra;africa;atlantic_slave_trade;african_slave_trade 

i want run trough , somehow convert this:

graph = {'a': ['b', 'c'],          'b': ['c', 'd'],          'c': ['d'],          'd': ['c'],          'e': ['f'],          'f': ['c']} 

note: 'a': edges , others os nodes in path.

at sametime want keep track of how many times each node visited?


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -