I tried to change the code, but cython did not let me. Nor connected_segments[coord_list[:,0],coord_list[:,1], coord_list[:,2]] = adjacent.
I don't know if I'm missing something here