DOC: Fixes for SA04 errors in docstrings
State: closed

- [x] Fixes for #28792 
- [x] tested through ./scripts/validate_docstrings.py

Labels:
name: Docs

Comments:
Hello @suparnasnair! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



* In the file [`pandas/core/arrays/base.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/arrays/base.py):

> [Line 811:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/arrays/base.py#L811): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (106 > 88 characters)









* In the file [`pandas/core/arrays/period.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/arrays/period.py):

> [Line 858:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/arrays/period.py#L858): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (100 > 88 characters)

* In the file [`pandas/core/base.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/base.py):

> [Line 1152:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/base.py#L1152): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (103 > 88 characters)



* In the file [`pandas/core/dtypes/base.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/dtypes/base.py):

> [Line 19:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/dtypes/base.py#L19): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (99 > 88 characters)





* In the file [`pandas/core/groupby/groupby.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/groupby/groupby.py):

> [Line 1661:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/groupby/groupby.py#L1661): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)

* In the file [`pandas/core/indexes/accessors.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/accessors.py):

> [Line 234:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/accessors.py#L234): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (111 > 88 characters)

* In the file [`pandas/core/indexes/base.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/base.py):

> [Line 807:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/base.py#L807): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (96 > 88 characters)
> [Line 2072:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/base.py#L2072): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (106 > 88 characters)
> [Line 3871:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/base.py#L3871): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)
> [Line 4297:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/base.py#L4297): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (99 > 88 characters)

* In the file [`pandas/core/indexes/datetimelike.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/datetimelike.py):

> [Line 409:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/datetimelike.py#L409): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)
> [Line 466:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/datetimelike.py#L466): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)

* In the file [`pandas/core/indexes/datetimes.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/datetimes.py):

> [Line 1383:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/datetimes.py#L1383): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (105 > 88 characters)
> [Line 1384:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/indexes/datetimes.py#L1384): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (104 > 88 characters)



* In the file [`pandas/core/missing.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/missing.py):

> [Line 395:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/missing.py#L395): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (103 > 88 characters)
> [Line 440:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/missing.py#L440): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (99 > 88 characters)

* In the file [`pandas/core/resample.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/resample.py):

> [Line 227:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/resample.py#L227): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (95 > 88 characters)
> [Line 228:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/resample.py#L228): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (107 > 88 characters)
> [Line 230:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/resample.py#L230): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)
> [Line 437:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/resample.py#L437): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)
> [Line 885:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/resample.py#L885): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (101 > 88 characters)





* In the file [`pandas/core/window/expanding.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/window/expanding.py):

> [Line 91:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/window/expanding.py#L91): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (119 > 88 characters)
> [Line 92:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/window/expanding.py#L92): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (115 > 88 characters)
> [Line 93:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/core/window/expanding.py#L93): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (89 > 88 characters)





* In the file [`pandas/io/formats/style.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/formats/style.py):

> [Line 714:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/formats/style.py#L714): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (98 > 88 characters)
> [Line 749:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/formats/style.py#L749): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (104 > 88 characters)
> [Line 810:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/formats/style.py#L810): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (99 > 88 characters)

* In the file [`pandas/io/html.py`](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/html.py):

> [Line 528:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/html.py#L528): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (92 > 88 characters)
> [Line 529:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/html.py#L529): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (92 > 88 characters)
> [Line 1044:89](https://github.com/pandas-dev/pandas/blob/235c38dea0a03d8bde193028eb819ef44be07a2e/pandas/io/html.py#L1044): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (99 > 88 characters)





##### Comment last updated at 2019-11-01 11:14:04 UTC
@suparnasnair : Thanks for the PR!  And welcome to `pandas` !

You're off to a good start, and I think as a next step, you should review your changes and condense them to just modifying the documentation.  Some of your changes are changing actual code, which is probably why there are test failures.
Thanks. A few changes suggested, otherwise looks good.

I can see now that you took some of the strings from the referenced functions. In those cases you can just ignore my comments and let those be fixed seperately.
Hi @topper-123, thanks for pointing out the corrections! I'm working on it now.
Hi @topper-123 , I have made changes as per your review comments, please have a look.
I have few pep8 requirements to update as well, which I will be doing today.  Thanks!
@suparnasnair looks to be a merge conflict as we've had some changes to the groupby modules. Can you resolve?
Sure @WillAyd. I'm on it.
Hi @WillAyd, I have updated the code.  Now the only conflict is because of the extra line added due to the docstrings that I added.  Please review.
Hi @topper-123 , I've updated based on your review.
Single remaining issue is in pandas/core/dtypes/cast.py, those are not doc issues so should not be part of this PR. Else look good.

EDIT: same goes for pandas/core/groupby/generic.py, (non-doc changes should not be in this PR).
Hi @datapythonista, thanks for the comments. I'll merge and rebase the code once again and commit them. Working on it.
Hi @datapythonista and @topper-123 , I have fixed all the merge issues.  Please let me know if there are any other updates required.  Thanks!
You've got changes to the code, not only docstrings. Are those intended? Have a look at the "Changes" tab to see what you're proposing, and if it's not what you intend please revert the changes from merges that didn't work as expected. I think I commented before how to do it, but let me know if you need help.

Thanks!
Hi @datapythonista , what I was doing is, merging my branch with master every time so as to update the changes made in those files to my branch.  But since, changes are made to those files mostly on a daily basis, the files in my branch always shows a conflict, since they are out-dated.  Could you please help me on what to do on that, if I perform a merge again with the master, this would definitely change the next day.  Or is it expected to not perform those merges?  

Thanks a lot in advance for the help, I'm just getting a hang of this slowly as I am new to this environment.
You've got lots of unrelated changes you need to undo. See my comments above. Those are the ones that are conflicting, since you shouldn't have them and they are quite big. Your intended changes won't conflict, nobody else is modifying those see also sections.

So, first thing make sure you don't have unintended changes. Then we can continue.
Hi @topper-123 , sorry I was away for a while.  Here I can see conflicts in only three files. So if I resolve those conflict, there will not be a merge issue, correct?  
The idea here is that from some pandas version changes evolved in two different directions, your changes, and the changes everybody else did in master since you started. And some of these changes touch the same lines.

Merging means that you apply changes from one branch to another. In this case you want to merge all the changes in master since you started working in this branch, into your branch. Then your branch will be master plus your changes.

When you do this, you'll have to tell git how to resolve the conflicts in the part of the code that have been touched in both cases, in the 3 files you can see. To do it:
- First download all the new changes in pandas `git fetch upstream`
- Then, do the merge, from your branch: `git merge upstream/master`
- With this, git will complain about these 3 files
- Edit the files, and leave them so changes in masters and your changes are applied.
- Remove all the lines that git added to help you understand what changed `=========` kind of stuff
- `git diff upstream/master` to see the final changes (what you'll be proposing to change). This should be the changes you'd make if you worked on this PR today
- Once you're happy, `git add` the files that were conflicting
- To finish the merge, with the conflicts resolved `git commit -m "Merging from master"`
- Then just push, `git push`, and we'll be able to merge this if it's ready
I see that in this case you have many unintended changes. Those are probably the ones that are causing the conflicts. You can check the Files changes tab of this PR to see what they are. If they are not many, just change restore manually the original content.

For files that have lots of changes, and few updates to the see also made by you, you can `git checkout upstream/master pandas/core/dtypes/cast.py` (or the appropriate file name), and then reapply your changes again, should be faster.

Before doing the merge, run a `git diff upstream/master` and see what changes not to the docstrings are, and keep iterating until you just have your own changes to the see also version.

For the next contribution you make, make sure you work in small chunks of changes, will make your life easier.
@suparnasnair let me know when you're done, there are no conflicts, and there are no changes to the code, but only to the docstrings in https://github.com/pandas-dev/pandas/pull/28815/files and I'll have another look. Or if you need help.
@datapythonista , I have for now removed all the changes I've made to those files. Currently there are no conflicts.  I will create separate pull requests for the changes I intended to make (docstrings) for these files.  Please have a look.
can you merge master
@suparnasnair looks like some merge conflicts have crept in - any chance you can fix those?
Closing as stale, @suparnasnair let us know if you want to finish this, and we'll reopen.