def str_wrap(arr, width, **kwargs):
 kwargs['width'] = width
 tw = textwrap.TextWrapper(**kwargs)
 return _na_map((lambda s: '\n'.join(tw.wrap(s))), arr)

def str_wrap ( arr , width , ** kwargs ) : kwargs [ 'width' ] = width tw = textwrap . TextWrapper ( ** kwargs ) return _na_map ( ( lambda s : '\n' . join ( tw . wrap ( s ) ) ) , arr )
wrap long strings in the series/index to be formatted in paragraphs with length less than a given width .