wrap(self, width, **kwargs)
This method has the same keyword parameters and defaults as textwrap.TextWrapper
.
Internally, this method uses a textwrap.TextWrapper
instance with default settings. To achieve behavior matching R's stringr library str_wrap function, use the arguments:
expand_tabs = False
replace_whitespace = True
drop_whitespace = True
break_long_words = False
break_on_hyphens = False
Maximum line width.
If True, tab characters will be expanded to spaces (default: True).
If True, each whitespace character (as defined by string.whitespace) remaining after tab expansion will be replaced by a single space (default: True).
If True, whitespace that, after wrapping, happens to end up at the beginning or end of a line is dropped (default: True).
If True, then words longer than width will be broken in order to ensure that no lines are longer than width. If it is false, long words will not be broken, and some lines may be longer than width (default: True).
If True, wrapping will occur preferably on whitespace and right after hyphens in compound words, as it is customary in English. If false, only whitespaces will be considered as potentially good places for line breaks, but you need to set break_long_words to false if you want truly insecable words (default: True).
Wrap strings in Series/Index at specified line width.
>>> s = pd.Series(['line to be wrapped', 'another line to be wrapped'])See :
... s.str.wrap(12) 0 line to be\nwrapped 1 another line\nto be\nwrapped dtype: object
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them