🍾 Xarray is now 10 years old! 🎉

xarray.DataArray.str.center

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 of int) – Minimum width of resulting string; additional characters will be filled with fillchar. If array-like, it is broadcast.

  • fillchar (str or array-like of str, default: " ") – Additional character for filling, default is a space. If array-like, it is broadcast.

Returns:

filled (same type as values)