<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1520" rel="nofollow">http://projects.scipy.org/scipy/ticket/1520</a> on 2011-09-15 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stefanv/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stefanv">@stefanv</a>, assigned to unknown.</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def shift(input, shift):
   &quot;&quot;&quot;
   Shift an array like  scipy.ndimage.interpolation.shift(input, shift, mode=&quot;wrap&quot;, order=0) but faster
   @param in: 2d numpy array
   @param d: 2-tuple of integers=20
   @return: shifted image
   &quot;&quot;&quot;
   re =  numpy.zeros_like(input)
   s0, s1 =  input.shape
   d0 =  shift[0] % s0
   d1 =  shift[1] % s1
   r0 =  (-d0) % s0
   r1 =  (-d1) % s1
   re[d0:, d1:] =  input[:r0, :r1]
   re[:d0, d1:] =  input[r0:, :r1]
   re[d0:, :d1] =  input[:r0, r1:]
   re[:d0, :d1] =  input[r0:, r1:]
   return re

a=np.arange(12).reshape((3,4))
print &quot;Input:\n&quot;, a, &quot;\n&quot;
print &quot;Ndimage:\n&quot;, interpolation.shift(a, (1, 1), mode=&quot;wrap&quot;, order=0), &quot;\n&quot;
print &quot;Custom:\n&quot;, shift(a, (1, 1)), &quot;\n&quot;"><pre class="notranslate"><code class="notranslate">def shift(input, shift):
   """
   Shift an array like  scipy.ndimage.interpolation.shift(input, shift, mode="wrap", order=0) but faster
   @param in: 2d numpy array
   @param d: 2-tuple of integers=20
   @return: shifted image
   """
   re =  numpy.zeros_like(input)
   s0, s1 =  input.shape
   d0 =  shift[0] % s0
   d1 =  shift[1] % s1
   r0 =  (-d0) % s0
   r1 =  (-d1) % s1
   re[d0:, d1:] =  input[:r0, :r1]
   re[:d0, d1:] =  input[r0:, :r1]
   re[d0:, :d1] =  input[:r0, r1:]
   re[:d0, :d1] =  input[r0:, r1:]
   return re

a=np.arange(12).reshape((3,4))
print "Input:\n", a, "\n"
print "Ndimage:\n", interpolation.shift(a, (1, 1), mode="wrap", order=0), "\n"
print "Custom:\n", shift(a, (1, 1)), "\n"
</code></pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Input:
[[ 0  1  2  3]
 [ 4  5  6  7]
 [ 8  9 10 11]] 

Ndimage:
[[6 4 5 6]
 [2 0 1 2]
 [6 4 5 6]] 

Custom:
[[11  8  9 10]
 [ 3  0  1  2]
 [ 7  4  5  6]] "><pre class="notranslate"><code class="notranslate">Input:
[[ 0  1  2  3]
 [ 4  5  6  7]
 [ 8  9 10 11]] 

Ndimage:
[[6 4 5 6]
 [2 0 1 2]
 [6 4 5 6]] 

Custom:
[[11  8  9 10]
 [ 3  0  1  2]
 [ 7  4  5  6]] 
</code></pre></div>
<p dir="auto">This already includes the mailmap updates currently in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="898898589" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/14110" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/14110/hovercard" href="https://github.com/scipy/scipy/pull/14110">#14110</a>.</p>
<p dir="auto">If you see a duplicated/incomplete/incorrectly formatted name, feel free to suggest the appropriate change or GitHub handle to ping.</p>
<p dir="auto">I've been having to manually deleted a "user" named <code class="notranslate">GitHub</code> for the last several releases--not sure where that is getting injected from, but not a big deal anyway.</p>
<h1 dir="auto">Authors</h1>
<ul dir="auto">
<li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/endolith/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/endolith">@endolith</a></li>
<li>Jelle Aalbers +</li>
<li>Adam +</li>
<li>Tania Allard +</li>
<li>Sven Baars +</li>
<li>Max Balandat +</li>
<li>baumgarc +</li>
<li>Christoph Baumgarten</li>
<li>Peter Bell</li>
<li>Lilian Besson</li>
<li>Robinson Besson +</li>
<li>Max Bolingbroke</li>
<li>Blair Bonnett +</li>
<li>Jordão Bragantini</li>
<li>Harm Buisman +</li>
<li>Evgeni Burovski</li>
<li>Matthias Bussonnier</li>
<li>Dominic C</li>
<li>CJ Carey</li>
<li>Ramón Casero +</li>
<li>charlotte12l +</li>
<li>Benjamin Curtice Corbett +</li>
<li>Falcon Dai +</li>
<li>Ian Dall +</li>
<li>Terry Davis</li>
<li>droussea2001 +</li>
<li>DWesl +</li>
<li>dwight200 +</li>
<li>Thomas J. Fan +</li>
<li>Joseph Fox-Rabinovitz</li>
<li>Max Frei +</li>
<li>Laura Gutierrez Funderburk +</li>
<li>gbonomib +</li>
<li>Matthias Geier +</li>
<li>Pradipta Ghosh +</li>
<li>GitHub</li>
<li>Ralf Gommers</li>
<li>Evan H +</li>
<li>h-vetinari</li>
<li>Matt Haberland</li>
<li>Anselm Hahn +</li>
<li>Alex Henrie</li>
<li>Piet Hessenius +</li>
<li>Elisha Hollander +</li>
<li>Stephan Hoyer</li>
<li>Tom Hu +</li>
<li>Kei Ishikawa +</li>
<li>Julien Jerphanion</li>
<li>Robert Kern</li>
<li>Shashank KS +</li>
<li>Peter Mahler Larsen</li>
<li>Eric Larson</li>
<li>Cheng H. Lee +</li>
<li>Gregory R. Lee</li>
<li>Jean-Benoist Leger +</li>
<li>lgfunderburk +</li>
<li>liam-o-marsh +</li>
<li>Xingyu Liu +</li>
<li>Alex Loftus +</li>
<li>Christian Lorentzen +</li>
<li>Cong Ma</li>
<li>Marc +</li>
<li>MarkPundurs +</li>
<li>Markus Löning +</li>
<li>Liam Marsh +</li>
<li>Nicholas McKibben</li>
<li>Jamie Morton</li>
<li>Andrew Nelson</li>
<li>Nikola Forró</li>
<li>Tor Nordam +</li>
<li>Olivier Gauthé +</li>
<li>Rohit Pandey +</li>
<li>Tirth Patel</li>
<li>paugier +</li>
<li>Alex H. Wagner, PhD +</li>
<li>Jeff Plourde +</li>
<li>Ilhan Polat</li>
<li>Vladyslav Rachek</li>
<li>Bharat Raghunathan</li>
<li>Recursing +</li>
<li>Tyler Reddy</li>
<li>Lucas Roberts</li>
<li>Gregor Robinson +</li>
<li>Pamphile Roy +</li>
<li>Atsushi Sakai</li>
<li>Benjamin Santos</li>
<li>Martin K. Scherer +</li>
<li>Thomas Schmelzer +</li>
<li>Daniel Scott +</li>
<li>Sebastian Wallkötter +</li>
<li>serge-sans-paille +</li>
<li>Namami Shanker +</li>
<li>Masashi Shibata +</li>
<li>Alexandre de Siqueira +</li>
<li>Albert Steppi +</li>
<li>Adam J. Stewart +</li>
<li>Kai Striega</li>
<li>Søren Fuglede Jørgensen</li>
<li>Mike Taves</li>
<li>Dan Temkin +</li>
<li>Robert Uhl</li>
<li>christos val +</li>
<li>Bas van Beek +</li>
<li>Ashutosh Varma +</li>
<li>Sebastiano Vigna</li>
<li>Aditya Vijaykumar</li>
<li>VNMabus</li>
<li>Arthur Volant +</li>
<li>Samuel Wallan</li>
<li>Stefan van der Walt</li>
<li>Warren Weckesser</li>
<li>Anreas Weh</li>
<li>Josh Wilson</li>
<li>Rory Yorke</li>
<li>Marc Zoeller +</li>
<li>zoj613 +</li>
<li>秋纫 +</li>
</ul>
<p dir="auto">A total of 117 people contributed to this release.<br>
People with a "+" by their names contributed a patch for the first time.<br>
This list of names is automatically generated, and may not be fully complete.</p>
<p dir="auto">NOTE: Check this list manually! It is automatically generated and some names<br>
may be missing.</p>