SciPy

This is documentation for an old release of NumPy (version 1.17). Read this page in the documentation of the latest stable release (version 2.2).

numpy.char.zfill

numpy.char.zfill(a, width)

Return the numeric string left-filled with zeros

Calls str.zfill element-wise.

Parameters:
a : array_like, {str, unicode}

Input array.

width : int

Width of string to left-fill elements in a.

Returns:
out : ndarray, {str, unicode}

Output array of str or unicode, depending on input type

See also

str.zfill

Previous topic

numpy.char.upper

Next topic

numpy.char.equal