Skip to content
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

DOC/CLN: Revise StringMethods docs #9843

Merged
merged 1 commit into from
May 1, 2015

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Apr 9, 2015

Derived from #9773, #9667. Fix docstrings to meet what current .str accessors does.

@jreback jreback added the Docs label Apr 9, 2015
@jreback jreback added this to the 0.16.1 milestone Apr 9, 2015
others : list or array, or list of arrays
If None, returns str concatenating strings of the Series
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this wording it sounds as all the strings in the series are concatenated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but this is also the case ..
This is quite a different behaviour when having others or not. Maybe some more explanation or an example would be useful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it is better. Added an example.

@sinhrks sinhrks added the Strings String extension data type and string data label Apr 24, 2015
@sinhrks
Copy link
Member Author

sinhrks commented Apr 24, 2015

@jorisvandenbossche Thank you for your comments.

Thanks to #9667, Index now support .str accessor. I've tried to describe the Series/Index return values but may not be clear because it shares the same docstring...

CC: @mortada Can you check if you have a chance?

@sinhrks sinhrks changed the title (WIP) DOC/CLN: Revise StringMethods docs DOC/CLN: Revise StringMethods docs Apr 24, 2015
Return boolean array indicating whether each string starts with passed
pattern
Return boolean ``Series``/``array`` indicating whether each string in the ``Series``/``Index``
starts with passed pattern. Equivalent to :meth:`str.startswith(pat)`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the HTML doc will append () and this would show up as "equivalent to str.startswith(pat)()", probably best to remove the (pat) at the end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or it would even error, I am not sure. But indeed, just use str.startswith here

@mortada
Copy link
Contributor

mortada commented Apr 24, 2015

@sinhrks spotted a few minor things (please see comments inline) but otherwise looks good to me, thanks!


Examples
--------
If list-like is specified as an argument, corresponding values are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be If others is specified ... ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But nice examples!

@jorisvandenbossche
Copy link
Member

@sinhrks One more general comment: you now used Series``/``Index almost everywhere, but I think in general we don't quote Series or DataFrame in our docstrings.
Also in the docstrings here you used both forms (eg unquoted in the parameter explanations or returns section).

I don't think we have a strict rule about this (and in the tutorial docs it is a bit mixed as well), but maybe we should keep it unquoted in the docstring? Opinion?

@sinhrks
Copy link
Member Author

sinhrks commented Apr 25, 2015

@jorisvandenbossche , @mortada Thanks for the comments. I've fixed the docs based on the points.

About quotes:

I also didn't have a fixed policy, only an impression that no need to quote return values because these are rendered as italic. I agree removing quote is more consistent. How should array be (remove or quote)?

@jorisvandenbossche
Copy link
Member

@sinhrks is this good to go?

@sinhrks
Copy link
Member Author

sinhrks commented May 1, 2015

Yes, pls check.

jorisvandenbossche added a commit that referenced this pull request May 1, 2015
DOC/CLN: Revise StringMethods docs
@jorisvandenbossche jorisvandenbossche merged commit 4b58538 into pandas-dev:master May 1, 2015
@jorisvandenbossche
Copy link
Member

Thanks! Always good to have more work on the docs

@sinhrks
Copy link
Member Author

sinhrks commented May 2, 2015

Thanks for review! Lmk if needs any follow-ups.

@sinhrks sinhrks deleted the str_returntype branch May 4, 2015 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants