netsse.tools.misc_func.pad ========================== .. py:function:: netsse.tools.misc_func.pad(U, axis=1, add=0) Adds zeros to an array along one of its dimensions. :param U: Input array to be padded with zeros at the beginning. :type U: array_like of shape (n,m) or (n,) :param axis: If ``U`` is a 2d-array, the axis of ``U`` along which to pad. The default is ``1``. :type axis: {1,0}, optional :param add: Term that is added to the concatenated zeros. :type add: float or array_like, default 0 :returns: **U_pad** -- Extended array, where ``U`` has been padded with a first column (respectively, row) of zeros (plus an optional added term). .. note:: - If ``U`` is a 2d-array, then the output array ``U_pad`` has a new shape of ``(n+1*(axis==0),m+1*(axis==1))``. - If ``U`` is a 1d-array, then the output array ``U_pad`` has a new shape of ``(n+1,)``. A zero element has been added at the beginning. :rtype: array_like .. seealso:: :py:obj:`wrap` Wraps an array around one of its dimensions. .. rubric:: Example >>> U_wrap = pad(U,axis=1,add=0)