My approach is to use the zfill
function to zero fill to left for a base 36 number of length 5, e.g.:
np.base_repr(x, 36).lower().zfill(5)
I also want the result in lower case as it will form part of a Kubernetes pod name, for consistency with conventions, hence I added .lower()
.