Skip to content

ENH: Implement core/strings/wrap method #6999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from

Conversation

jeffreystarr
Copy link
Contributor

This patch implements the str.wrap function within core/strings.

Example:

    >>> s = pd.Series(['line to be wrapped', 'another line to be wrapped'])
    >>> s.str.wrap(12)
    0             line to be\nwrapped
    1    another line\nto be\nwrapped

This is a cleaned branch; the original is at #6705.

This patch implements the str_wrap function within
core/strings. The implementation follows the behavior
of R's stringr library. When a string is 'wrap'ped,
the return value will be a paragraph with lines of
max(word length, width) length.
…R's stringr library defaults and semantics (width being exclusive).
Expanded docstring with description of major optional parameters and added an example.
@jreback
Copy link
Contributor

jreback commented Apr 29, 2014

@jorisvandenbossche ok?

@jeffreystarr looks good, i will rebase/squash you on merge

@jorisvandenbossche
Copy link
Member

yep, looking good! (I think all comments were already adressed)

@jreback
Copy link
Contributor

jreback commented Apr 29, 2014

merged via 5b838ab

thanks!

@jreback jreback closed this Apr 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants