title: Normalizing matrix row scipy matrix
body: <p>I wish to normalize each row of a sparse scipy matrix, obtained from a networkx directed graph.</p>
  
  <pre><code> import networkx as nx
   import numpy as np
  
  G=nx.random_geometric_graph(10,0.3)
  M=nx.to_scipy_sparse_matrix(G, nodelist=G.nodes())
  
  from __future__ import division
  
   print(M[3])
    (0, 1)        1
    (0, 5)        1
  
  print(M[3].multiply(1/M[3].sum()))                                                                                                                                                                                                                                         
    (0, 1)        0.5
    (0, 5)        0.5
  </code></pre>
  
  <p>this is ok, I normalize as usual and it's working as desired.
  But if I write:</p>
  
  <pre><code>&gt;&gt;&gt; M[3]=M[3].multiply(1/M[3].sum())
  &gt;&gt;&gt; M[3]
  &lt;1x10 sparse matrix of type '&lt;type 'numpy.int64'&gt;'
          with 10 stored elements in Compressed Sparse Row format&gt;
    (0, 0)        0
    (0, 1)        0
    (0, 2)        0
    (0, 3)        0
    (0, 4)        0
    (0, 5)        0
    (0, 6)        0
    (0, 7)        0
    (0, 8)        0
    (0, 9)        0
  </code></pre>
  
  <p>I just need to iterate over each row and normalize over this sparse scipy matrix. 
  How would you do this? 
  Thanks</p>