numpy.strings.zfill#
- strings.zfill(a, width)[source]#
Return the numeric string left-filled with zeros
Calls
str.zfill
element-wise.- Parameters:
- aarray_like, with
StringDType
,bytes_
orstr_
dtype Input array.
- widthint
Width of string to left-fill elements in a.
- aarray_like, with
- Returns:
- outndarray
Output array of
StringDType
,bytes_
orstr_
dtype, depending on input types
See also
Examples
>>> np.strings.zfill('1', 3) array('001', dtype='<U3')