title: display edge weights on networkx graph
body: <p>I have a dataframe with 3 columns: f1, f2 and score. I want to draw a graph (using NetworkX) to display the nodes (in f1 and f2) and edge-values to be the 'score'. I am able to draw the graph with nodes and their names. But, I am unable to display the edge-scores. Can anyone help please?</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>import networkx as nx
  import pandas as pd
  import matplotlib.pyplot as plt
  
  
  feature_1 = ['Boston', 'Boston', 'Chicago', 'ATX', 'NYC']
  feature_2 = ['LA', 'SFO', 'LA', 'ATX', 'NJ']
  score = ['1.00', '0.83', '0.34', '0.98', '0.89']
  
  df = pd.DataFrame({'f1': feature_1, 'f2': feature_2, 'score': score})
  print(df)
  
  G = nx.from_pandas_edgelist(df=df, source='feature_1', target='feature_2', edge_attr='score')
  pos = nx.spring_layout(G)
  nx.draw(G, pos, with_labels=True)
  
  #nx.draw_networkx_edge_labels(G, pos, edge_labels=labels)
  
  plt.show()
  </code></pre>