title: Adding weight to nodes
body: <p>I've defined the dictionary for the weights of the nodes:</p>
  <pre class="lang-py prettyprint-override"><code>  dict_exports={}
  
  for index,x in myDataTrade.iterrows():
          dict_exports.setdefault(x['from'],0.)
          dict_exports[x['from']]+=float(x['VAL'])
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>def plot_sub_graph_trade(COUNTRY,FILTER,dict_exports,myDataTrade,FILTER_YEAR,FILTER_TYPE):
  
      myDataTradeSWE = myDataTrade[(myDataTrade['from']==COUNTRY) &amp; (myDataTrade['VAL']&gt;FILTER) &amp; (myDataTrade['Year']==FILTER_YEAR) &amp; (myDataTrade['type']==FILTER_TYPE)]
  
      G=nx.Graph() 
  
      
      for index,x in myDataTradeSWE.iterrows():
          G.add_edge(x['from'],x['to'],w=x['VAL'])
  
      color_code=[]  
      for i in G.edges():
          color_code.append(G[i[0]][i[1]]['w'])  
  
      nodes_label={}
      n_size=[]
      for i in G.nodes():
          nodes_label[i]=str(i)
          n_size.append(dict_exports[i]/1000000.) 
  
      plt.figure(1,figsize=(8,8)) 
      plt.title('High Tech Trade Network of '+COUNTRY+' in '+str(FILTER_YEAR))
      nx.draw(G, pos=nx.kamada_kawai_layout(G),alpha=0.9,
              node_size=500,width=4,edge_cmap=plt.cm.Purples,edge_color=color_code,
              node_color='#A0CBE2',labels=nodes_label,font_size=11,font_color='Black')
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>COUNTRY='SWE'
  FILTER=250000
  FILTER_YEAR=2016
  FILTER_TYPE= 'High_Tech'
  plot_sub_graph_trade(COUNTRY,FILTER,dict_exports,myDataTrade,FILTER_YEAR,FILTER_TYPE)
  </code></pre>
  <p>The code returns the network graph but does not integrate the dictionaries, so the weights are not affecting the nodes. I'm not sure if I missed a mistake? pls help.</p>