<p dir="auto">Worked around in CI by pinning to 1.8.5, see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="426708741" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/9987" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/9987/hovercard" href="https://github.com/scipy/scipy/pull/9987">gh-9987</a></p>
<p dir="auto">For the issue, see e.g. <a href="https://circleci.com/gh/scipy/scipy/12334" rel="nofollow">https://circleci.com/gh/scipy/scipy/12334</a>. It ends with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
./scipy-ref.tex:25: fontspec error: &quot;font-not-found&quot;
! 
! The font &quot;FreeSerif&quot; cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H &lt;return&gt;.
!...............................................  
                                                  
l.25 ]
      
No pages of output.
Transcript written on scipy-ref.log.
Latexmk: Log file says no output from latex
Latexmk: For rule 'pdflatex', no output was made
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Makefile:32: recipe for target 'scipy-ref.pdf' failed
make: *** [scipy-ref.pdf] Error 12
make: Leaving directory '/home/circleci/repo/doc/build/latex'
Exited with code 2"><pre class="notranslate"><code class="notranslate">
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
./scipy-ref.tex:25: fontspec error: "font-not-found"
! 
! The font "FreeSerif" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H &lt;return&gt;.
!...............................................  
                                                  
l.25 ]
      
No pages of output.
Transcript written on scipy-ref.log.
Latexmk: Log file says no output from latex
Latexmk: For rule 'pdflatex', no output was made
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Makefile:32: recipe for target 'scipy-ref.pdf' failed
make: *** [scipy-ref.pdf] Error 12
make: Leaving directory '/home/circleci/repo/doc/build/latex'
Exited with code 2
</code></pre></div>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1889" rel="nofollow">http://projects.scipy.org/scipy/ticket/1889</a> on 2013-04-10 by trac user avneesh, assigned to unknown.</em></p>
<p dir="auto">Hello all,</p>
<p dir="auto">I notice a somewhat bizarre issue when constructing sparse matrices by initializing with 3-tuples (row index, column index, value).</p>
<p dir="auto">The following is a slight abstraction to what my exact code is, but it shows the behavior:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kNN = 10
dataset_size = 1661165
rowIdx = np.empty((kNN+1)*dataset_size)
colIdx = np.empty((kNN+1)*dataset_size)
vals = np.empty((kNN+1)*dataset_size)
for i, line in enumerate(data):
  #perform certain operations
print vals.size, colIdx.size, rowIdx.size
print vals[np.nonzero(vals)].size
W = sp.csc_matrix((vals, (rowIdx, colIdx)), shape=(dataset_size, dataset_size))
print W.nnz"><pre class="notranslate"><code class="notranslate">kNN = 10
dataset_size = 1661165
rowIdx = np.empty((kNN+1)*dataset_size)
colIdx = np.empty((kNN+1)*dataset_size)
vals = np.empty((kNN+1)*dataset_size)
for i, line in enumerate(data):
  #perform certain operations
print vals.size, colIdx.size, rowIdx.size
print vals[np.nonzero(vals)].size
W = sp.csc_matrix((vals, (rowIdx, colIdx)), shape=(dataset_size, dataset_size))
print W.nnz
</code></pre></div>
<p dir="auto">The printed outputs I get are the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="18272815 18272815 18272815
18272815
18272465"><pre class="notranslate"><code class="notranslate">18272815 18272815 18272815
18272815
18272465
</code></pre></div>
<p dir="auto">Therefore, as you can see, there is a difference of 18272815-18272465 = 350 elements that should be non-zero in the resulting sparse matrix, but are not.</p>
<p dir="auto">I have verified in the rowIdx and colIdx arrays that there are no duplicates, i.e., a given (rowIdx, colIdx) pair does not appear twice (otherwise two values would map to the same position in the sparse matrix).  As per my understanding, I should get 18272815 elements in the resulting sparse matrix, but I fall 350 elements short.</p>
<p dir="auto">Is this expected behavior? Am I doing something wrong?</p>
<p dir="auto">I am running Linux x86-64-bit OpenSuSE 11.4, NumPy version 1.5.1, SciPy version 0.9.0, Python 2.7.</p>