<p dir="auto">My issue is about scipy.signal.medfilt(values, window). It works perfectly between values[(window+1)/2 : -(window+1)/2]. Near the edges it returns a ascending sorted list of values at the beginning and descending sorted list of values at the end.</p>
<p dir="auto">This should be <em>either</em> metioned in the document <em>or</em> fixed as a proper median.</p>
<p dir="auto">The input list at the example below:<br>
<code class="notranslate">values = [0,1,1,0.8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1]</code></p>
<p dir="auto"><strong>should produce</strong> (assuming nanmedian behavior for values outside the list):</p>
<p dir="auto">0: median([nan, nan, nan,0,1,1,0.8]) = (0.8+1)/2 = 0.9<br>
1: median([nan,nan,0,1,1,0.8,1]) = 1<br>
2: median([nan,0,1,1,0.8,1,1) = 1<br>
3: median([0,1,1,0.8,1,1,1]) = 1<br>
4: median([1,1,1,0.8,1,1,1]) = 1</p>
<p dir="auto">The output should thus start as [0.9,1,1,1,1,1,...]</p>
<p dir="auto"><strong>alternatively</strong> if the window size is reduced when approaching the edge:</p>
<p dir="auto">0: median([0]) = 0<br>
1: median([0,1) = 0.5<br>
2: median([0,1,1]) = 1<br>
3: median([0,1,1,0.8]) =(0.8+1)/2 = 0.9<br>
4: median([0,1,1,0.8,1]) = 1.0</p>
<p dir="auto">The output should then start [0,0.5,1,0.9,1,1,1,1,1,...]</p>
<p dir="auto"><strong>Instead the actual output</strong> start is [0,0.8,1,1,...] which is a sorted list of first 4 elements.</p>
<p dir="auto">The same happens at the end.</p>
<p dir="auto">This current output is perfectly ok <em>if</em> it would be mentioned in the documentation. For example: "Medfilt returns the median with a running window when index is greater than (window+1)/2. The beginning of the output is the ascending list of input values upto the (window+1)/2. Behavior is the same near the end of the input list but with descending input values from indices - (window+1)/2"</p>
<h4 dir="auto">Reproducing code example:</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy.signal import medfilt 
values = [0,1,1,0.8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1]
print(medfilt(values,7))"><pre class="notranslate"><code class="notranslate">from scipy.signal import medfilt 
values = [0,1,1,0.8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1]
print(medfilt(values,7))
</code></pre></div>
<h4 dir="auto">Scipy/Numpy/Python version information:</h4>

<p dir="auto">Python 3.8 64bit</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.4.0 1.17.4 sys.version_info(major=3, minor=8, micro=0, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">1.4.0 1.17.4 sys.version_info(major=3, minor=8, micro=0, releaselevel='final', serial=0)
</code></pre></div>
<p dir="auto">Python 2.7 32bit</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="('1.2.2', '1.15.4', sys.version_info(major=2, minor=7, micro=15, releaselevel='final', serial=0))"><pre class="notranslate"><code class="notranslate">('1.2.2', '1.15.4', sys.version_info(major=2, minor=7, micro=15, releaselevel='final', serial=0))
</code></pre></div>
<p dir="auto">Hi, I have been facing a lot of issues while installing python packages such as scipy, skearn, numpy, spacy and scikit-learn. I tried using pip, conda but unfortunately i was not able to install all requirements. Is there any problem of mac m1 processor with packages like scipy, skearn, numpy, spacy and scikit-learn</p>
<p dir="auto">I tried a lot and seeking a way to get the things resolved.</p>