MCPcopy Index your code
hub / github.com/pydata/xarray / center

Method center

xarray/core/accessor_str.py:1348–1371  ·  view source on GitHub ↗

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

(
        self, width: int | Any, fillchar: str | bytes | Any = " "
    )

Source from the content-addressed store, hash-verified

1346 return self._apply(func=overfunc, func_args=(width, fillchar))
1347
1348 def center(
1349 self, width: int | Any, fillchar: str | bytes | Any = " "
1350 ) -> T_DataArray:
1351 """
1352 Pad left and right side of each string in the array.
1353
1354 If `width` or 'fillchar` is array-like, they are broadcast
1355 against the array and applied elementwise.
1356
1357 Parameters
1358 ----------
1359 width : int or array-like of int
1360 Minimum width of resulting string; additional characters will be
1361 filled with ``fillchar``. If array-like, it is broadcast.
1362 fillchar : str or array-like of str, default: " "
1363 Additional character for filling, default is a space.
1364 If array-like, it is broadcast.
1365
1366 Returns
1367 -------
1368 filled : same type as values
1369 """
1370 func = self._obj.dtype.type.center
1371 return self._padder(func=func, width=width, fillchar=fillchar)
1372
1373 def ljust(
1374 self,

Callers

nothing calls this directly

Calls 1

_padderMethod · 0.95

Tested by

no test coverage detected