You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this solution works: https://stackoverflow.com/a/2778068 but it would be interesting for the Numpy API to have this useful option (in the same way np.pad has constant mode, etc.)
The text was updated successfully, but these errors were encountered:
Proposed new feature or change:
In many situations, it is required to shift an array (like
np.roll
) and fill the values with zeros, instead of making the array "loop".Is there a way to implement this:
?
Example : python numpy roll with padding
Important notes:
solutions with
np.pad
exist but are slower, see https://stackoverflow.com/questions/2777907/python-numpy-roll-with-padding#comment3270288_3153267other people have the needs for this: https://stackoverflow.com/questions/2777907/python-numpy-roll-with-padding#comment120688507_2778068: I think np.roll should do it natively with a keyword argument. (quite upvoted)
this solution works: https://stackoverflow.com/a/2778068 but it would be interesting for the Numpy API to have this useful option (in the same way
np.pad
hasconstant
mode, etc.)The text was updated successfully, but these errors were encountered: