[Numpy-discussion] Is there a defined way to "unpad" an array, and if not, should there be?

Benjamin Root ben.v.root at gmail.com
Mon Apr 12 16:27:55 EDT 2021


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?

On Mon, Apr 12, 2021 at 4:15 PM Jeff Gostick <jgostick at gmail.com> wrote:

> 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.  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]).  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.
>
>
> Jeff G
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20210412/4be29a5c/attachment.html>


More information about the NumPy-Discussion mailing list