bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / signal / _arraytools / zero_ext
function
scipy.signal._arraytools:zero_ext
source: build-install/usr/lib/python3.14/site-packages/scipy/signal/_arraytools.py:215
Signature
def zero_ext(x, n, axis = -1)Summary
Zero padding at the boundaries of an array
Extended Summary
Generate a new ndarray that is a zero-padded extension of x along an axis.
Parameters
x: ndarrayThe array to be extended.
n: intThe number of elements by which to extend
xat each end of the axis.axis: int, optionalThe axis along which to extend
x. Default is -1.
Examples
import numpy as np from scipy.signal._arraytools import zero_ext a = np.array([[1, 2, 3, 4, 5], [0, 1, 4, 9, 16]]) zero_ext(a, 2)✓
array([[ 0, 0, 1, 2, 3, 4, 5, 0, 0],
[ 0, 0, 0, 1, 4, 9, 16, 0, 0]])
Aliases
scipy.signal._arraytools.zero_ext