Skip to content

DOC: fix mistake in Series.str.cat #21330

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

Merged
merged 2 commits into from
Jun 6, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2172,9 +2172,9 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):

Returns
-------
concat : str if `other is None`, Series/Index of objects if `others is
not None`. In the latter case, the result will remain categorical
if the calling Series/Index is categorical.
concat :
str if `others` is None, Series/Index of objects if `others` is not
None.
Copy link
Member

@gfyoung gfyoung Jun 6, 2018

Choose a reason for hiding this comment

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

  1. I would still put all possible data-types right after the concat: part.

  2. OCD kicking in here: can we rephrase so that None isn't by itself on that last line?

Copy link
Member

Choose a reason for hiding this comment

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

@h-vetinari : Moving your reply here to the thread:

@gfyoung
It doesn't fit, unfortunately. Otherwise I would have left it there as well.

Current state:
fix_str_cat_doc_curr

Propsed:
fix_str_cat_doc_new

I'm guessing this is mainly due to the docstring parser + linelength-limit; it might work without a line break - I could do a #noqa line, I guess?

Copy link
Member

@gfyoung gfyoung Jun 6, 2018

Choose a reason for hiding this comment

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

  1. The dtype suggestion I made should be do-able on one line.

  2. For these types of issues with a single word on one line, you can try rewriting the whole description e.g.:

If `other` is None, `str` is returned, otherwise `Series / Index` of objects is returned.

We generally try avoid using noqa unless absolutely necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. See new suggestion


See Also
--------
Expand Down