<p dir="auto">Hey,</p>
<p dir="auto">I hope that I did not made major flaws but I can not find a mistake. The output of argrelextrema() is always an empty numpy array.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
from scipy.signal import argrelextrema

dat = np.genfromtxt(&quot;numbers.dat&quot;)
print argrelextrema(dat[:], np.greater, order=6)"><pre class="notranslate"><code class="notranslate">import numpy as np
from scipy.signal import argrelextrema

dat = np.genfromtxt("numbers.dat")
print argrelextrema(dat[:], np.greater, order=6)
</code></pre></div>
<p dir="auto"><em>(array([], dtype=int64),)</em></p>
<p dir="auto"><code class="notranslate">numbers.dat</code> contains a list of 50 testvalues containing a maximum. I also tested several values for the <code class="notranslate">order</code> parameter</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="78.75
81.0                                                                                                                                
83.25
85.5
87.75
89.25
91.5
93.0
94.5
96.75
98.25
99.75
101.25
102.0
103.5
104.25
105.75
106.5
107.25
108.0
108.75
108.75
109.5
109.5
109.5
109.5
109.5
109.5
109.5
108.75
108.75
108.0
107.25
106.5
105.75
105.0
104.25
102.75
102.0
100.5
99.0
97.5
96.0
94.5
93.0
90.75
89.25
87.0
84.75
82.5"><pre class="notranslate"><code class="notranslate">78.75
81.0                                                                                                                                
83.25
85.5
87.75
89.25
91.5
93.0
94.5
96.75
98.25
99.75
101.25
102.0
103.5
104.25
105.75
106.5
107.25
108.0
108.75
108.75
109.5
109.5
109.5
109.5
109.5
109.5
109.5
108.75
108.75
108.0
107.25
106.5
105.75
105.0
104.25
102.75
102.0
100.5
99.0
97.5
96.0
94.5
93.0
90.75
89.25
87.0
84.75
82.5
</code></pre></div>
<p dir="auto">Thanks for any comments!<br>
Stephan</p>
<p dir="auto">Scipy documentation lists scipy.sparse.dok_matrix as having three methods that return iterators:</p>
<ul dir="auto">
<li>iteritems()</li>
<li>iterkeys()</li>
<li>itervalues()</li>
</ul>
<p dir="auto">None of these seem to exist. Example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy import sparse
A = np.random.rand(100,100)
As = sparse.dok_matrix(A)
As.iteritems() #&lt;------ This raises an AttributeError: iteritems not found."><pre class="notranslate"><code class="notranslate">from scipy import sparse
A = np.random.rand(100,100)
As = sparse.dok_matrix(A)
As.iteritems() #&lt;------ This raises an AttributeError: iteritems not found.
</code></pre></div>