The problem that you are facing is that your subgraph command tells it to make a subgraph with a nodelist, where each element is not only the name of the node, but also data about that node name. The command G.subgraphneeds only a list of node names.
The easiest way to fix this is simply
k = G.subgraph(res)
which will work even if some of the nodes in are resnot in G.
, , , . k, , , k. , , subgraph.
import networkx as nx
from matplotlib import pylab as pl
G = nx.karate_club_graph()
res = [0,1,2,3,4,5, 'parrot']
pos = nx.spring_layout(G)
k = G.subgraph(res)
pl.figure()
nx.draw_networkx(k, pos=pos)
othersubgraph = G.subgraph(range(6,G.order()))
nx.draw_networkx(othersubgraph, pos=pos, node_color = 'b')
pl.show()

data=True G.nodes() :
print G.nodes()
> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]
print G.nodes(data=True)
> [(0, {'club': 'Mr. Hi'}), (1, {'club': 'Mr. Hi'}), (2, {'club': 'Mr. Hi'}), (3, {'club': 'Mr. Hi'}), (4, {'club': 'Mr. Hi'}), (5, {'club': 'Mr. Hi'}), (6, {'club': 'Mr. Hi'}), (7, {'club': 'Mr. Hi'}) ... *I've snipped stuff out*
G.nodes() node. G.nodes(data=True) , node , dict .