Pandas
pandas.pydata.org › docs › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 3.0.5 documentation - PyData |
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 3.0.5 documentation
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Pandas
pandas.pydata.org › pandas-docs › version › 2.0 › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 2.0.3 documentation
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Pandas
pandas.pydata.org › pandas-docs › version › 0.25.0 › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 0.25.0 documentation
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills boths sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-‘ in the string.
Pandas
pandas.pydata.org › docs › dev › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas documentation
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Pandas
pandas.pydata.org › pandas-docs › version › 2.1 › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 2.1.4 documentation - PyData |
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Pandas
pandas.pydata.org › pandas-docs › version › 1.5 › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 1.5.2 documentation
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Pandas
pandas.pydata.org › pandas-docs › version › 0.25.2 › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 0.25.2 documentation
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills boths sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-‘ in the string.
w3resource
w3resource.com › pandas › series › series-str-zfill.php
Pandas Series: str.zfill() function - w3resource
May 20, 2026 - Pandas Series: str.zfill() function: The str.zfill() function is used to pad strings in the Series/Index by prepending '0' characters.
Pandas
pandas.pydata.org › pandas-docs › version › 2.1.1 › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 2.1.1 documentation - PyData |
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Intelpython
intelpython.github.io › sdc-doc › latest › _api_ref › pandas.Series.str.zfill.html
pandas.Series.str.zfill — Intel® Scalable Dataframe Compiler 0.1 documentation
Fills the right side of strings with an arbitrary character. Series.str.pad · Fills the specified sides of strings with an arbitrary character. Series.str.center · Fills boths sides of strings with an arbitrary character. Todo · Add support of 32-bit Unicode for str.zfill() What is Intel® SDC?
Pandas
pandas.pydata.org › docs › reference › api › pandas.Series.str.pad.html
pandas.Series.str.pad — pandas 3.0.6 documentation - PyData |
Fills the right side of strings with an arbitrary character. Equivalent to Series.str.pad(side='right'). Series.str.center · Fills both sides of strings with an arbitrary character. Equivalent to Series.str.pad(side='both'). Series.str.zfill · Pad strings in the Series/Index by prepending ...
Pandas
pandas.pydata.org › pandas-docs › version › 2.1.0 › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 2.1.0 documentation - PyData |
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.Series.str.zfill.html
pandas.Series.str.zfill — pandas 3.0.3 documentation
Fills the right side of strings with an arbitrary character. ... Fills the specified sides of strings with an arbitrary character. ... Fills both sides of strings with an arbitrary character. ... Differs from str.zfill() which has special handling for ‘+’/’-’ in the string.
Top answer 1 of 8
155
str attribute contains most of the methods in string.
df['ID'] = df['ID'].str.zfill(15)
See more: http://pandas.pydata.org/pandas-docs/stable/text.html
2 of 8
124
Try:
df['ID'] = df['ID'].apply(lambda x: '{0:0>15}'.format(x))
or even
df['ID'] = df['ID'].apply(lambda x: x.zfill(15))