lentil.pad#
- lentil.pad(array, shape)[source]#
Zero-pad an array.
Note that pad works for both two and three dimensional arrays.
- Parameters:
array (array_like) – Array to be padded.
shape (tuple of ints) – Shape of output array in
(nrows, ncols)
.
- Returns:
padded – Zero-padded array with shape
(nrows, ncols)
. Ifarray
has a third dimension, the return shape will be(nrows, ncols, depth)
.- Return type:
ndarray