Stay organized with collections Save and categorize content based on your preferences.
Pad an array to a given length. The pad value will be repeatedly appended to the array to extend it to given length along each axis. If the array is already as large or larger than a given length, it will remain unchanged along that axis.

Array.pad(lengths, pad)Array
this: arrayArrayArray to pad.
lengthsListA list of new lengths for each axis.
padNumber, default: 0The value with which to pad the array.