[Edit] Actually, this is a networkx problem where I is a list of nodes in array format (not in the nx.nodes list) (in networkx); I want to record these 100 sets of nodes as X = { I1,I2,...,I100 } in a file. The file should contain 100 lines and each line should contain the list of nodes infected which are separated by a space. Then afterwards I have to make a graph (actually a subgraph) with each of these list of nodes Ii and find the centre of each of these subgraphs , i.e 100 centres [Edit]
This iteration generates a list of 100 np.arrays of I how to store all these 100 arrays in a variable so that I can use this data later on. Preferably a text file! The following doesn't work!
I_collect = np.zeros(5)
for counter in range(100):
t, S, I = EoN.fast_SIS(g, tau, gamma, tmax = 10, initial_infecteds = 0)
I_collect(counter) = I;
error:
I_collect(counter) = I;
^
SyntaxError: can't assign to function call