<div dir="ltr">Isn't that just slicing? Or perhaps you are looking for a way to simplify the calculation of the slice arguments from the original pad arguments?<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 12, 2021 at 4:15 PM Jeff Gostick <<a href="mailto:jgostick@gmail.com">jgostick@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">



















<p style="margin:0cm;font-size:11pt;font-family:"Calibri",sans-serif">I often find myself padding an array to do some
processing on it (i.e. to avoid edge artifacts), then I need to remove the
padding.<span>  </span>I wish there was either a built
in "unpad" function that accepted the same arguments as
"pad", or that "pad" accepted negative numbers (e.g [-20,
-4] would undo a padding of [20, 4]).<span> 
</span>This seems like a pretty obvious feature to me so maybe I've just missed
something, but I have looked through all the open and closed issues on github
and don't see anything related to this. <br></p><p style="margin:0cm;font-size:11pt;font-family:"Calibri",sans-serif"><br></p><p style="margin:0cm;font-size:11pt;font-family:"Calibri",sans-serif">Jeff G<br></p><p style="margin:0cm;font-size:11pt;font-family:"Calibri",sans-serif"><span></span></p>





</div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>