how can i make a square matrix from a nested dict?

I just did a walkaround with a list.

dis = dict(nx.all_pairs_shortest_path_length(graph))

Nations = list(dis.keys())
master = [[""]]

for x in Nations:

for Nat1 in dis:
    for Nat2 in Nations:

Thanks for everyone taking care of this problem. Have a wonderful day!

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top