Q: how to create python correspondence between matrix and edge I have a graph G with a list of edges
G.edges()=[(1, 5), (1, 6), (2, 5), (3, 4), (3, 6), (4, 5), (4, 7), (6, 7)

What I want to do is iterate over each of these edges and create 2D numpy arrays G15, G16, ... , G67 where the array names correspond to the edges.
How can I do this?

A: Sounds like you want to do something like
i, j = 1,3
$G{i}{j}=np.array(....)

with the intention of later either doing:
G13[:,3]= ...
or
$G{i}{j}[0,1]=...

There are languages that let you create variable names like this.  Early Basic may have done this.  But Python is not one of those.  Constructing variable names programmatically is an adhoc approach.
Instead in Python you collect objects, such as arrays, in lists and dictionaries, e.g.
[np.array(...) for i,j in G.edges()]

{(i,j):np.array(...) for i,j in G.edges()}

{'G%i%j'%(i,j): np.array(...) for i,j in G.edges()}

There are ways of adding dictionaries like this to the local namespace (which is also a dictionary), but that's borderline poor Python practice.
With the arrays collected in a list or dictionary it is easy to iterate through them or to reference them individually.  There are various ways of associating edges (your tuples) with arrays (or other Python objects), but global variable names isn't a good one (possible but not Pythonic).

A: You can make a list of your desired array names like so:
arrayNames = ["G"+str(n)+str(m) for (n, m) in G.edges()]

The rest of the solution depends on what form you want your arrays in, i.e. how you want to access them - dictionary, list of tuples, etc.?
