Commit b9d35494 authored by Norbert Marwan's avatar Norbert Marwan
Browse files

update to make Python 3 compatible

parent 025b3cae
......@@ -66,7 +66,7 @@ def __divide_at_midpoint(G):
Returns subgraphs by cutting the recurrence network at the midpoint.
"""
n = G.vcount()
inds1, inds2 = range(0, n / 2), range(n / 2, n)
inds1, inds2 = range(0, int(n / 2)), range(int(n / 2), n)
G1, G2 = G.subgraph(G.vs[inds1]), G.subgraph(G.vs[inds2])
return G1, G2
......@@ -82,10 +82,10 @@ def community_strength_data(G, time, wsize, wstep,
n = G.vcount()
nwind = ((n - wsize) / wstep) + 1
tmid = []
Q, LD = [np.zeros(nwind) for i in range(2)]
Q, LD = [np.zeros(int(nwind)) for i in range(2)]
_printmsg("Estimating intra-community link fraction...", verbose)
prog_bar = _progressbar_start(n, pbar)
for i in range(nwind):
for i in range(int(nwind)):
k = i * wstep
start, stop = k, k + wsize
t_ = (time[start:stop]).sum() / wsize
......@@ -109,11 +109,11 @@ def community_strength_random_model(G, time, wsize, wstep, nsurr,
n = G.vcount()
nwind = ((n - wsize) / wstep) + 1
tmid = []
Qsurr, LDsurr = [np.zeros((nwind, nsurr), "float") for i in range(2)]
Qsurr, LDsurr = [np.zeros((int(nwind), int(nsurr)), "float") for i in range(2)]
_printmsg("Estimating intra-community link fraction...", verbose)
prog_bar = _progressbar_start(nwind*nsurr, pbar)
count = 0
for i in range(nwind):
for i in range(int(nwind)):
k = i * wstep
start, stop = k, k + wsize
t_ = (time[start:stop]).sum() / wsize
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment