Hello everyone,
I hope this is the correct place to post this as this is my first (potential)
contribution to numpy.
I would like to implement a function numpy.shift which would work similarly to
numpy.roll, with one key difference. After shifting an array by a value
`shift`, the function fills the missing values with a `fill_value`
For example shifting the following array by 1 along axis 1with fill_value of 0
>>> arr = numpy.arange(10).reshape((2,5))
>>> arr
array([[0, 1, 2, 3, 4],
[5, 6, 7, 8, 9]])
>>> numpy.shift(arr, 1, axis=1, fill_value=0)
array([[0, 0, 1, 2, 3],
[0, 5, 6, 7, 8]])
Cheers,
Filippo
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: [email protected]