xarray.DataArray.str.center#
- DataArray.str.center(width, fillchar=' ')[source]#
Pad left and right side of each string in the array.
If width or ‘fillchar` is array-like, they are broadcast against the array and applied elementwise.
- Parameters
width (
int
or array-like ofint
) – Minimum width of resulting string; additional characters will be filled withfillchar
. If array-like, it is broadcast.fillchar (
str
or array-like ofstr
, default:" "
) – Additional character for filling, default is a space. If array-like, it is broadcast.
- Returns
filled (
same type as values
)