tenpy.tools.misc.pad(a, w_l=0, v_l=0, w_r=0, v_r=0, axis=0)[source]

Pad an array along a given axis.

Parameters
andarray

w_lint

the width to be padded in the front

v_ldtype

the value to be inserted before a

w_rint

the width to be padded after the last index

v_ldtype

the value to be inserted after a

axisint

the axis along which to pad

Returns