I am looking for a Python function that can implement the functionality of movmin. I have included the Matlab description of movmin below.
M = movmin(A,k)returns an array of localk-point centered minimum values, where each minimum is calculated over a sliding window of lengthkacross neighboring elements ofA. Whenkis odd, the window is centered about the element in the current position. Whenkis even, the window is centered about the current and previous elements. The window size is automatically truncated at the endpoints when there are not enough elements to fill the window. When the window is truncated, the minimum is taken over only the elements that fill the window.Mis the same size asA.If
Ais a vector, thenmovminoperates along the length of the vector.If
Ais a multidimensional array, thenmovminoperates along the first array dimension whose size does not equal 1.
My input is a multi-dimensional array.