padarray

emlib.numpytools.padarray(arr, numelements, padwith=0)[source]

Pad a 1D array to the right, or a 2D array down

Pad 1D with 2 elements:

1 2 3 4   -> 1 2 3 4 0 0

Pad 2D with 2 elements:

0   1  2      0  1  2
10 11 12  -> 10 11 12
20 21 22     20 21 22
              0  0  0
              0  0  0
Return type:

ndarray