🍾 Xarray is now 10 years old! πŸŽ‰

xarray.DataArray.str.zfill

xarray.DataArray.str.zfill#

DataArray.str.zfill(width)[source]#

Pad each string in the array by prepending β€˜0’ characters.

Strings in the array are padded with β€˜0’ characters on the left of the string to reach a total string length width. Strings in the array with length greater or equal to width are unchanged.

If width is array-like, it is broadcast against the array and applied elementwise.

Parameters:

width (int or array-like of int) – Minimum length of resulting string; strings with length less than width be prepended with β€˜0’ characters. If array-like, it is broadcast.

Returns:

filled (same type as values)