<p dir="auto">This is a bit newbie-unfriendly:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; def f(params, data):
...     return (...)
&gt;&gt;&gt; minimize(f, x0, args=mydata)
...
TypeError: can only concatenate tuple (not &quot;list&quot;) to tuple"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; def f(params, data):
...     return (...)
&gt;&gt;&gt; minimize(f, x0, args=mydata)
...
TypeError: can only concatenate tuple (not "list") to tuple
</code></pre></div>
<p dir="auto">This could use similar logic as in <code class="notranslate">scipy.integrate.quad</code>, which has</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if not isinstance(args, tuple):
    args = (args,)"><pre class="notranslate"><code class="notranslate">if not isinstance(args, tuple):
    args = (args,)
</code></pre></div>
<p dir="auto">I was a bit unexpected behavior using gaussian_filter, especially on image boundaries - corners. I have generated a noisy image with a Gaussian distribution and that I was expecting that using a Gaussian filter with sufficient sigma I get an image with zeros. But I got high positive values in top-left, and bottom-right corner and negative values in top-right and bottom-left corner; and this values go up to 0.5 of initial sigma used for generating.</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage

np.random.seed(0)
im = np.random.normal(loc=0, scale=0.3, size=(300, 250))
im_blur1 = ndimage.gaussian_filter(im, sigma=50, order=0, mode='nearest')

plt.figure(figsize=(12, 5))
plt.subplot(121), plt.title('image')
plt.imshow(im, plt.cm.gray), plt.colorbar()
plt.subplot(122), plt.title('scipy')
plt.imshow(im_blur1, plt.cm.gray), plt.colorbar()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span> <span class="pl-k">import</span> <span class="pl-s1">ndimage</span>

<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">seed</span>(<span class="pl-c1">0</span>)
<span class="pl-s1">im</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">normal</span>(<span class="pl-s1">loc</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">scale</span><span class="pl-c1">=</span><span class="pl-c1">0.3</span>, <span class="pl-s1">size</span><span class="pl-c1">=</span>(<span class="pl-c1">300</span>, <span class="pl-c1">250</span>))
<span class="pl-s1">im_blur1</span> <span class="pl-c1">=</span> <span class="pl-s1">ndimage</span>.<span class="pl-en">gaussian_filter</span>(<span class="pl-s1">im</span>, <span class="pl-s1">sigma</span><span class="pl-c1">=</span><span class="pl-c1">50</span>, <span class="pl-s1">order</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">mode</span><span class="pl-c1">=</span><span class="pl-s">'nearest'</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">figure</span>(<span class="pl-s1">figsize</span><span class="pl-c1">=</span>(<span class="pl-c1">12</span>, <span class="pl-c1">5</span>))
<span class="pl-s1">plt</span>.<span class="pl-en">subplot</span>(<span class="pl-c1">121</span>), <span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">'image'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">imshow</span>(<span class="pl-s1">im</span>, <span class="pl-s1">plt</span>.<span class="pl-s1">cm</span>.<span class="pl-s1">gray</span>), <span class="pl-s1">plt</span>.<span class="pl-en">colorbar</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">subplot</span>(<span class="pl-c1">122</span>), <span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">'scipy'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">imshow</span>(<span class="pl-s1">im_blur1</span>, <span class="pl-s1">plt</span>.<span class="pl-s1">cm</span>.<span class="pl-s1">gray</span>), <span class="pl-s1">plt</span>.<span class="pl-en">colorbar</span>()</pre></div>
<h3 dir="auto">Output</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6035284/41107229-38a6d908-6a72-11e8-9c37-8f9bf557c19a.png"><img src="https://user-images.githubusercontent.com/6035284/41107229-38a6d908-6a72-11e8-9c37-8f9bf557c19a.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
<p dir="auto">Scipy - 0.18.1<br>
Numpy - 1.12.1<br>
Python - 2.7.13<br>
('Linux', 'knuth', '4.9.0-6-amd64', '<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="661052" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/1" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/1/hovercard" href="https://github.com/scipy/scipy/pull/1">#1</a> SMP Debian 4.9.88-1+deb9u1 (2018-05-07)', 'x86_64')</p>