edges = np.random.randint(0, n_nodes, size=(n_edges, 2))
node_types = np.random.randint(0, 2, size=(n_nodes, n_types)).astype(np.bool)
s, e = edges.T
Accumulate values of "neigborhood" from edgelist with numpy