NumPy has several useful functions for arrays of strings. See NumPy docs on String operations. The function you are looking for is np.core.defchararray.zfill or its alias np.char.zfill.
Taking an example array from David Buck's answer:
>>> import numpy as np
>>> arr = np.array([[['3', '6', '12'],
['0', '1', '3'],
['5', 'T', '8'],
['19', '15', '11']],
[['6', '3', '1'],
['10', '10', 'QR'],
['7', '11', '9'],
['12', '13', '11']],
[['1', 'G', '3'],
['10', '9', '2'],
['18', '12', '17'],
['6', '1', '10']]])
>>> np.char.zfill(arr, 2)
array([[['03', '06', '12'],
['00', '01', '03'],
['05', '0T', '08'],
['19', '15', '11']],
[['06', '03', '01'],
['10', '10', 'QR'],
['07', '11', '09'],
['12', '13', '11']],
[['01', '0G', '03'],
['10', '09', '02'],
['18', '12', '17'],
['06', '01', '10']]], dtype='<U2')
If you want to avoid adding zeros to elements that are not digits, we can use boolean array indexing and np.core.defchararray.isdigit function or its alias np.char.isdigit:
>>> mask = np.char.isdigit(arr)
>>> mask
array([[[ True, True, True],
[ True, True, True],
[ True, False, True],
[ True, True, True]],
[[ True, True, True],
[ True, True, False],
[ True, True, True],
[ True, True, True]],
[[ True, False, True],
[ True, True, True],
[ True, True, True],
[ True, True, True]]])
>>> arr[mask] = np.char.zfill(arr[mask], 2)
>>> arr
array([[['03', '06', '12'],
['00', '01', '03'],
['05', 'T', '08'],
['19', '15', '11']],
[['06', '03', '01'],
['10', '10', 'QR'],
['07', '11', '09'],
['12', '13', '11']],
[['01', 'G', '03'],
['10', '09', '02'],
['18', '12', '17'],
['06', '01', '10']]], dtype='<U2')