xarray.core.accessor_str.StringAccessor.wrap¶
-
StringAccessor.
wrap
(width, **kwargs)[source]¶ Wrap long strings in the array in paragraphs with length less than width.
This method has the same keyword parameters and defaults as
textwrap.TextWrapper
.If width is array-like, it is broadcast against the array and applied elementwise.
- Parameters
width (
int
or array-like ofint
) – Maximum line-width. If array-like, it is broadcast.**kwargs – keyword arguments passed into
textwrap.TextWrapper
.
- Returns
wrapped (
same type as values
)