I am newcomer with python. Is there a way to remove all 'for loops' and use matrixes and vectors instead?
for trip in u_triplets:
sub_gr = G.subgraph(trip)
mot_match = [nx.is_isomorphic(sub_gr, motifs[mot_id]) for mot_id in list(motifs.keys())]
match_keys = [list(motifs.keys())[i] for i in range(len(motifs)) if mot_match[i]]
if len(match_keys) == 1:
mcount[match_keys[0]] += 1