Using NetworkX, and new to the library, for a social network analysis query. By Query, I mean select/create subgraphs by attributes of both edges nodes where the edges creat
Building on @Aric's answer, you can find red fish like this:
red_fish = set(n for u,v,d in G.edges_iter(data=True) if d['color']=='red' for n in (u, v) if G.node[n]['label']=='fish') print(red_fish) # set([2])