I have a list of subgraphs that I am attempting to access within a loop:
index=[5,3,4,1,1,3,4,2,3,4,2,2,3,3,2,4]
subgraph=[[subgraph1],[subgraph2],[subgraph3],[subgraph4],[subgraph5]]
for i in range(len(index)):
for j in range(i+1,len(index)):
if index[j]==index[i]
continue
testgraphi=copy.copy(subgraph[index[i]])
testgraphj=copy.copy(subgraph[index[j]])
so in the first loop through, testgraphi would be assigned subgraph5, and testgraphj would be assigned subgraph3. However, when I attempt this method, I am returned an error list indices must be integers, not numpy.float64. Which is logical, because index is ACTUALLY initialized as a numpy array in the full span of my program(and it must stay this way). So my question is, how can I cast this value so that it can be used as an index for my subgraph list? So that when testgraph is initialized, it will retrieve the value of index at which the loop is at, and use this to define which list index to return?