DOC: Capitalize docstring summaries of Series
State: closed

Updated documentation to resolve SS02 errors in pandas.Series

- [x] closes #23641
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Docs
name: Clean

Comments:
Hello @avolkov! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`pandas/core/arrays/sparse.py`](https://github.com/avolkov/pandas/blob/577bf80bd05b88ecdcaa8b1cf0397dba3bfad313/pandas/core/arrays/sparse.py) !

 - There are no PEP8 issues in the file [`pandas/core/base.py`](https://github.com/avolkov/pandas/blob/577bf80bd05b88ecdcaa8b1cf0397dba3bfad313/pandas/core/base.py) !

 - There are no PEP8 issues in the file [`pandas/core/generic.py`](https://github.com/avolkov/pandas/blob/577bf80bd05b88ecdcaa8b1cf0397dba3bfad313/pandas/core/generic.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/base.py`](https://github.com/avolkov/pandas/blob/577bf80bd05b88ecdcaa8b1cf0397dba3bfad313/pandas/core/indexes/base.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/datetimelike.py`](https://github.com/avolkov/pandas/blob/577bf80bd05b88ecdcaa8b1cf0397dba3bfad313/pandas/core/indexes/datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/core/series.py`](https://github.com/avolkov/pandas/blob/577bf80bd05b88ecdcaa8b1cf0397dba3bfad313/pandas/core/series.py) !



##### Comment last updated on November 20, 2018 at 16:35 Hours UTC
Nice work, thanks @avolkov 

Do you mind taking care in this PR or the next issue in the same docstrings you fixed:

We have this in many cases:
```
def foo():
    """ Returns whatever is computed """
```

But the right formatting would be:
```
def foo():
    """
    Returns whatever is computed.
    """
```

Besides the capital letter:
- The summary should be in the next line than the initial `"""`
- The first word, if a verb shouldn't be `Returns` (third-person) but `Return` the infinitive
- The Summary should finish with a period
-The closing quotes go to the next line

Sorry I didn't see that was wrong in these same docstrings, but if you can fix this here, that would be really great.
@datapythonista

Sure, I've noticed some of these strings were inconsistent.

I'll update current PR with fixes.
Can you merge master into your branch @avolkov. Not sure why the CI was cancelled for this PR, but that should trigger a new run.
Still no luck with the CI, can you merge master again please
I was sure something was wrong in master. If that doesn't work and re-run tests locally cherry-picking the changes.
@avolkov just realized that we have a test that it's checking the text in a docstring. That's what is making the CI fail. Can you take a look and fix it please?

This is what it's failing I think: `pandas/tests/series/test_internals.py:320`
```
    def test_hasnans_unchached_for_series():
        # GH#19700
        idx = pd.Index([0, 1])
        assert idx.hasnans is False
        assert 'hasnans' in idx._cache
        ser = idx.to_series()
        assert ser.hasnans is False
        assert not hasattr(ser, '_cache')
        ser.iloc[-1] = np.nan
        assert ser.hasnans is True
>       assert Series.hasnans.__doc__ == pd.Index.hasnans.__doc__
E       AssertionError: assert '\n        Re...ps.\n        ' == ' return if I ...erf speedups '
E         - 
E         -         Return if I have any nans; enables various perf speedups.
E         ?  ^^^^^^^^                                                       ^^
E         +  return if I have any nans; enables various perf speedups 
E         ?  ^                                                       ^
E         -
```
@avolkov can you fix the error in travis please:
```
./pandas/core/base.py:705:80: E501 line too long (80 > 79 characters)
```
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23647?src=pr&el=h1) Report
> Merging [#23647](https://codecov.io/gh/pandas-dev/pandas/pull/23647?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b4b945adad587851d570e950d05a1da75c5dc76c?src=pr&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `66.66%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/23647/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23647?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #23647      +/-   ##
==========================================
+ Coverage   92.24%   92.28%   +0.03%     
==========================================
  Files         161      161              
  Lines       51339    51461     +122     
==========================================
+ Hits        47360    47493     +133     
+ Misses       3979     3968      -11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <66.66%> (+0.04%)` | :arrow_up: |
| #single | `42.31% <66.66%> (-0.04%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23647?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZWxpa2UucHk=) | `97.74% <ø> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `93.68% <ø> (ø)` | :arrow_up: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `91.94% <ø> (+0.12%)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.84% <ø> (+0.01%)` | :arrow_up: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `97.61% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.48% <50%> (+0.02%)` | :arrow_up: |
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `95.96% <0%> (-0.19%)` | :arrow_down: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `97.76% <0%> (-0.13%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `86.04% <0%> (-0.04%)` | :arrow_down: |
| [pandas/core/arrays/integer.py](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2ludGVnZXIucHk=) | `95.47% <0%> (-0.02%)` | :arrow_down: |
| ... and [42 more](https://codecov.io/gh/pandas-dev/pandas/pull/23647/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23647?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23647?src=pr&el=footer). Last update [b4b945a...41a7ef5](https://codecov.io/gh/pandas-dev/pandas/pull/23647?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks!