title: Read sparse matrix in python
body: <p>I want to read a <strong>sparse matrix</strong>. When I am building <strong>ngrams</strong> using <strong>scikit learn</strong>. Its <strong>transform()</strong> gives output in sparse matrix. I want to read that matrix without doing <strong>todense()</strong>.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>import numpy as np
  from sklearn.feature_extraction.text import CountVectorizer
  document = ['john guy','nice guy']
  vectorizer = CountVectorizer(ngram_range=(1, 2))
  X = vectorizer.fit_transform(document)
  transformer = vectorizer.transform(document)
  print transformer
  </code></pre>
  
  <p><strong>Output :</strong> </p>
  
  <pre><code>  (0, 0)    1
    (0, 1)    1
    (0, 2)    1
    (1, 0)    1
    (1, 3)    1
    (1, 4)    1
  </code></pre>
  
  <p>How can I <strong>read</strong> this output to get its <strong>values</strong>. I need value at <strong>(0,0), (0,1)</strong> and so on and save into <strong>list</strong>.</p>