title: How do you make weight appear on matrix by using nx.to_numpy_matrix?
body: <p>I am making SNA network graph using networkx librabry from python. I used a lesmis.gml data(lesmiserable data) and the data is like this</p>
  <p><code>graph [ node [ id 0 label &quot;Myriel&quot; ] node [ id 1 label &quot;Napoleon&quot; ] node [ id 2 label &quot;MlleBaptistine&quot; ] node [ id 3 label &quot;MmeMagloire&quot; ] node [ id 4 label &quot;CountessDeLo&quot; ] node [ id 5 label &quot;Geborand&quot; ] node [ id 6 label &quot;Champtercier&quot; ] node [ id 7 label &quot;Cravatte&quot; ] node [ id 8 label &quot;Count&quot; ] node [ id 9 label &quot;OldMan&quot; ] node [ id 10 label &quot;Labarre&quot; ] node [ id 11 label &quot;Valjean&quot; ] node [ id 12 label &quot;Marguerite&quot; ] node [ id 13 label &quot;MmeDeR&quot; ] node [ id 14 label &quot;Isabeau&quot; ] node [ id 15 label &quot;Gervais&quot; ] node [ id 16 label &quot;Tholomyes&quot; ] node [ id 17 label &quot;Listolier&quot; ] node [ id 18 label &quot;Fameuil&quot; ] node [ id 19 label &quot;Blacheville&quot; ] node [ id 20 label &quot;Favourite&quot; ] node [ id 21 label &quot;Dahlia&quot; ] node [ id 22 label &quot;Zephine&quot; ] node [ id 23 label &quot;Fantine&quot; ] node [ id 24 label &quot;MmeThenardier&quot; ] node [ id 25 label &quot;Thenardier&quot; ] node [ id 26 label &quot;Cosette&quot; ] node [ id 27 label &quot;Javert&quot; ] node [ id 28 label &quot;Fauchelevent&quot; ] node [ id 29 label &quot;Bamatabois&quot; ] node [ id 30 label &quot;Perpetue&quot; ] node [ id 31 label &quot;Simplice&quot; ] node [ id 32 label &quot;Scaufflaire&quot; ] node [ id 33 label &quot;Woman1&quot; ] node [ id 34 label &quot;Judge&quot; ] node [ id 35 label &quot;Champmathieu&quot; ] node [ id 36 label &quot;Brevet&quot; ] node [ id 37 label &quot;Chenildieu&quot; ] node [ id 38 label &quot;Cochepaille&quot; ] node [ id 39 label &quot;Pontmercy&quot; ] node [ id 40 label &quot;Boulatruelle&quot; ] node [ id 41 label &quot;Eponine&quot; ] node [ id 42 label &quot;Anzelma&quot; ] node [ id 43 label &quot;Woman2&quot; ] node [ id 44 label &quot;MotherInnocent&quot; ] node [ id 45 label &quot;Gribier&quot; ] node [ id 46 label &quot;Jondrette&quot; ] node [ id 47 label &quot;MmeBurgon&quot; ] node [ id 48 label &quot;Gavroche&quot; ] node [ id 49 label &quot;Gillenormand&quot; ] node [ id 50 label &quot;Magnon&quot; ] node [ id 51 label &quot;MlleGillenormand&quot; ] node [ id 52 label &quot;MmePontmercy&quot; ] node [ id 53 label &quot;MlleVaubois&quot; ] node [ id 54 label &quot;LtGillenormand&quot; ] node [ id 55 label &quot;Marius&quot; ] node [ id 56 label &quot;BaronessT&quot; ] node [ id 57 label &quot;Mabeuf&quot; ] node [ id 58 label &quot;Enjolras&quot; ] node [ id 59 label &quot;Combeferre&quot; ] node [ id 60 label &quot;Prouvaire&quot; ] node [ id 61 label &quot;Feuilly&quot; ] node [ id 62 label &quot;Courfeyrac&quot; ] node [ id 63 label &quot;Bahorel&quot; ] node [ id 64 label &quot;Bossuet&quot; ] node [ id 65 label &quot;Joly&quot; ] node [ id 66 label &quot;Grantaire&quot; ] node [ id 67 label &quot;MotherPlutarch&quot; ] node [ id 68 label &quot;Gueulemer&quot; ] node [ id 69 label &quot;Babet&quot; ] node [ id 70 label &quot;Claquesous&quot; ] node [ id 71 label &quot;Montparnasse&quot; ] node [ id 72 label &quot;Toussaint&quot; ] node [ id 73 label &quot;Child1&quot; ] node [ id 74 label &quot;Child2&quot; ] node [ id 75 label &quot;Brujon&quot; ] node [ id 76 label &quot;MmeHucheloup&quot; ] edge [ source 1 target 0 value 1 ] edge [ source 2 target 0 value 8 ] edge [ source 3 target 0 value 10 ] edge [ source 3 target 2 value 6 ] edge [ source 4 target 0 value 1 ] edge [ source 5 target 0 value 1 ] edge [ source 6 target 0 value 1 ] edge [ source 7 target 0 value 1 ] edge [ source 8 target 0 value 2 ] edge [ source 9 target 0 value 1 ] edge [ source 11 target 10 value 1 ] edge [ source 11 target 3 value 3 ] edge [ source 11 target 2 value 3 ] edge [ source 11 target 0 value 5 ] edge [ source 12 target 11 value 1 ] edge [ source 13 target 11 value 1 ] edge [ source 14 target 11 value 1 ] edge [ source 15 target 11 value 1 ] edge [ source 17 target 16 value 4 ] edge [ source 18 target 16 value 4 ] edge [ source 18 target 17 value 4 ] edge [ source 19 target 16 value 4 ] edge [ source 19 target 17 value 4 ] edge [ source 19 target 18 value 4 ] edge [ source 20 target 16 value 3 ] edge [ source 20 target 17 value 3 ] edge [ source 20 target 18 value 3 ] edge [ source 20 target 19 value 4 ] edge [ source 21 target 16 value 3 ] edge [ source 21 target 17 value 3 ] edge [ source 21 target 18 value 3 ] edge [ source 21 target 19 value 3 ] edge [ source 21 target 20 value 5 ] edge [ source 22 target 16 value 3 ] edge [ source 22 target 17 value 3 ] edge [ source 22 target 18 value 3 ] edge [ source 22 target 19 value 3 ] edge [ source 22 target 20 value 4 ] edge [ source 22 target 21 value 4 ] edge [ source 23 target 16 value 3 ] edge [ source 23 target 17 value 3 ] edge [ source 23 target 18 value 3 ] edge [ source 23 target 19 value 3 ] edge [ source 23 target 20 value 4 ] edge [ source 23 target 21 value 4 ] edge [ source 23 target 22 value 4 ] edge [ source 23 target 12 value 2 ] edge [ source 23 target 11 value 9 ] edge [ source 24 target 23 value 2 ] edge [ source 24 target 11 value 7 ] edge [ source 25 target 24 value 13 ] edge [ source 25 target 23 value 1 ] edge [ source 25 target 11 value 12 ] edge [ source 26 target 24 value 4 ] edge [ source 26 target 11 value 31 ] edge [ source 26 target 16 value 1 ] edge [ source 26 target 25 value 1 ] edge [ source 27 target 11 value 17 ] edge [ source 27 target 23 value 5 ] edge [ source 27 target 25 value 5 ] edge [ source 27 target 24 value 1 ] edge [ source 27 target 26 value 1 ] edge [ source 28 target 11 value 8 ] edge [ source 28 target 27 value 1 ] edge [ source 29 target 23 value 1 ] edge [ source 29 target 27 value 1 ] edge [ source 29 target 11 value 2 ] edge [ source 30 target 23 value 1 ] edge [ source 31 target 30 value 2 ] edge [ source 31 target 11 value 3 ] edge [ source 31 target 23 value 2 ] edge [ source 31 target 27 value 1 ] edge [ source 32 target 11 value 1 ] edge [ source 33 target 11 value 2 ] edge [ source 33 target 27 value 1 ] edge [ source 34 target 11 value 3 ] edge [ source 34 target 29 value 2 ] edge [ source 35 target 11 value 3 ] edge [ source 35 target 34 value 3 ] edge [ source 35 target 29 value 2 ] edge [ source 36 target 34 value 2 ] edge [ source 36 target 35 value 2 ] edge [ source 36 target 11 value 2 ] edge [ source 36 target 29 value 1 ] edge [ source 37 target 34 value 2 ] edge [ source 37 target 35 value 2 ] edge [ source 37 target 36 value 2 ] edge [ source 37 target 11 value 2 ] edge [ source 37 target 29 value 1 ] edge [ source 38 target 34 value 2 ] edge [ source 38 target 35 value 2 ] edge [ source 38 target 36 value 2 ] edge [ source 38 target 37 value 2 ] edge [ source 38 target 11 value 2 ] edge [ source 38 target 29 value 1 ] edge [ source 39 target 25 value 1 ] edge [ source 40 target 25 value 1 ] edge [ source 41 target 24 value 2 ] edge [ source 41 target 25 value 3 ] edge [ source 42 target 41 value 2 ] edge [ source 42 target 25 value 2 ] edge [ source 42 target 24 value 1 ] edge [ source 43 target 11 value 3 ] edge [ source 43 target 26 value 1 ] edge [ source 43 target 27 value 1 ] edge [ source 44 target 28 value 3 ] edge [ source 44 target 11 value 1 ] edge [ source 45 target 28 value 2 ] edge [ source 47 target 46 value 1 ] edge [ source 48 target 47 value 2 ] edge [ source 48 target 25 value 1 ] edge [ source 48 target 27 value 1 ] edge [ source 48 target 11 value 1 ] edge [ source 49 target 26 value 3 ] edge [ source 49 target 11 value 2 ] edge [ source 50 target 49 value 1 ] edge [ source 50 target 24 value 1 ] edge [ source 51 target 49 value 9 ] edge [ source 51 target 26 value 2 ] edge [ source 51 target 11 value 2 ] edge [ source 52 target 51 value 1 ] edge [ source 52 target 39 value 1 ] edge [ source 53 target 51 value 1 ] edge [ source 54 target 51 value 2 ] edge [ source 54 target 49 value 1 ] edge [ source 54 target 26 value 1 ] edge [ source 55 target 51 value 6 ] edge [ source 55 target 49 value 12 ] edge [ source 55 target 39 value 1 ] edge [ source 55 target 54 value 1 ] edge [ source 55 target 26 value 21 ] edge [ source 55 target 11 value 19 ] edge [ source 55 target 16 value 1 ] edge [ source 55 target 25 value 2 ] edge [ source 55 target 41 value 5 ] edge [ source 55 target 48 value 4 ] edge [ source 56 target 49 value 1 ] edge [ source 56 target 55 value 1 ] edge [ source 57 target 55 value 1 ] edge [ source 57 target 41 value 1 ] edge [ source 57 target 48 value 1 ] edge [ source 58 target 55 value 7 ] edge [ source 58 target 48 value 7 ] edge [ source 58 target 27 value 6 ] edge [ source 58 target 57 value 1 ] edge [ source 58 target 11 value 4 ] edge [ source 59 target 58 value 15 ] edge [ source 59 target 55 value 5 ] edge [ source 59 target 48 value 6 ] edge [ source 59 target 57 value 2 ] edge [ source 60 target 48 value 1 ] edge [ source 60 target 58 value 4 ] edge [ source 60 target 59 value 2 ] edge [ source 61 target 48 value 2 ] edge [ source 61 target 58 value 6 ] edge [ source 61 target 60 value 2 ] edge [ source 61 target 59 value 5 ] edge [ source 61 target 57 value 1 ] edge [ source 61 target 55 value 1 ] edge [ source 62 target 55 value 9 ] edge [ source 62 target 58 value 17 ] edge [ source 62 target 59 value 13 ] edge [ source 62 target 48 value 7 ] edge [ source 62 target 57 value 2 ] edge [ source 62 target 41 value 1 ] edge [ source 62 target 61 value 6 ] edge [ source 62 target 60 value 3 ] edge [ source 63 target 59 value 5 ] edge [ source 63 target 48 value 5 ] edge [ source 63 target 62 value 6 ] edge [ source 63 target 57 value 2 ] edge [ source 63 target 58 value 4 ] edge [ source 63 target 61 value 3 ] edge [ source 63 target 60 value 2 ] edge [ source 63 target 55 value 1 ] edge [ source 64 target 55 value 5 ] edge [ source 64 target 62 value 12 ] edge [ source 64 target 48 value 5 ] edge [ source 64 target 63 value 4 ] edge [ source 64 target 58 value 10 ] edge [ source 64 target 61 value 6 ] edge [ source 64 target 60 value 2 ] edge [ source 64 target 59 value 9 ] edge [ source 64 target 57 value 1 ] edge [ source 64 target 11 value 1 ] edge [ source 65 target 63 value 5 ] edge [ source 65 target 64 value 7 ] edge [ source 65 target 48 value 3 ] edge [ source 65 target 62 value 5 ] edge [ source 65 target 58 value 5 ] edge [ source 65 target 61 value 5 ] edge [ source 65 target 60 value 2 ] edge [ source 65 target 59 value 5 ] edge [ source 65 target 57 value 1 ] edge [ source 65 target 55 value 2 ] edge [ source 66 target 64 value 3 ] edge [ source 66 target 58 value 3 ] edge [ source 66 target 59 value 1 ] edge [ source 66 target 62 value 2 ] edge [ source 66 target 65 value 2 ] edge [ source 66 target 48 value 1 ] edge [ source 66 target 63 value 1 ] edge [ source 66 target 61 value 1 ] edge [ source 66 target 60 value 1 ] edge [ source 67 target 57 value 3 ] edge [ source 68 target 25 value 5 ] edge [ source 68 target 11 value 1 ] edge [ source 68 target 24 value 1 ] edge [ source 68 target 27 value 1 ] edge [ source 68 target 48 value 1 ] edge [ source 68 target 41 value 1 ] edge [ source 69 target 25 value 6 ] edge [ source 69 target 68 value 6 ] edge [ source 69 target 11 value 1 ] edge [ source 69 target 24 value 1 ] edge [ source 69 target 27 value 2 ] edge [ source 69 target 48 value 1 ] edge [ source 69 target 41 value 1 ] edge [ source 70 target 25 value 4 ] edge [ source 70 target 69 value 4 ] edge [ source 70 target 68 value 4 ] edge [ source 70 target 11 value 1 ] edge [ source 70 target 24 value 1 ] edge [ source 70 target 27 value 1 ] edge [ source 70 target 41 value 1 ] edge [ source 70 target 58 value 1 ] edge [ source 71 target 27 value 1 ] edge [ source 71 target 69 value 2 ] edge [ source 71 target 68 value 2 ] edge [ source 71 target 70 value 2 ] edge [ source 71 target 11 value 1 ] edge [ source 71 target 48 value 1 ] edge [ source 71 target 41 value 1 ] edge [ source 71 target 25 value 1 ] edge [ source 72 target 26 value 2 ] edge [ source 72 target 27 value 1 ] edge [ source 72 target 11 value 1 ] edge [ source 73 target 48 value 2 ] edge [ source 74 target 48 value 2 ] edge [ source 74 target 73 value 3 ] edge [ source 75 target 69 value 3 ] edge [ source 75 target 68 value 3 ] edge [ source 75 target 25 value 3 ] edge [ source 75 target 48 value 1 ] edge [ source 75 target 41 value 1 ] edge [ source 75 target 70 value 1 ] edge [ source 75 target 71 value 1 ] edge [ source 76 target 64 value 1 ] edge [ source 76 target 65 value 1 ] edge [ source 76 target 66 value 1 ] edge [ source 76 target 63 value 1 ] edge [ source 76 target 62 value 1 ] edge [ source 76 target 48 value 1 ] edge [ source 76 target 58 value 1 ] ] </code></p>
  <p>Here's my code to draw network graph.</p>
  <pre><code>import numpy as np
  import networkx as nx
  import matplotlib.pyplot as plt
  import zipfile
  from google.colab import files
  
  
  
  myfile = files.upload()
  G = nx.read_gml('lesmis.gml')
  pos = nx.spring_layout(G)
  nx.draw_networkx(G, pos,with_labels=True,node_color = 'yellow', node_size = 200, edge_color = 'green',arrowsize = 1000, width = 1 )
  labels = nx.get_edge_attributes(G, 'value')
  nx.draw_networkx_edge_labels(G, pos, edge_labels=labels)
  </code></pre>
  <p>I want to make matrix by using nx.to_numpy_matrix(G) but this only shows binary figure(1,0). I want the figure in matrix to be a 'value'(=weight) from dataset. How do you do this ?</p>