pandas.Series.str.zfill

pandas 3.1.1 · Series and accessors · method

Pad the left side of strings with zeroes to reach a minimum width.

Call syntax

Series.str.zfill(width)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
width Required
Positional or keyword
int

Set the requested width of the formatted result.

Returns

Series/Index of objects.