DOC: Fix flake8 issues with whatsnew v0.18.*
State: closed

Fixed almost every flake8 issues in v0.18.*.rst except one issue
about tab-completion.

- [x] closes #24233 
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

I fixed almost every flake8 issues except one.
An issue about **tab-completion** and I have no idea how to fix it.

In `doc/source/whatsnew/v0.18.0.rst` there is a code like below.
```python
In [9]: r.<TAB>
r.A           r.agg         r.apply       r.count       r.exclusions  r.max         r.median      r.name        r.skew        r.sum
r.B           r.aggregate   r.corr        r.cov         r.kurt        r.mean        r.min         r.quantile    r.std         r.var
```

I've searched with `grep` in every whatsnew files but there was only one other example about this in `v0.17.0.rst`. Would you review this PR?

Labels:
name: Docs
name: Clean

Comments:
thanks @JimJeon : Please wait for a formal review from the maintainers.  I just want to point that you have to remove the block between 8 & 11 for both the files (the below chunk should be deleted). Removal should generate some more errors. 

```
.. ipython:: python
   :suppress:

   from pandas import * # noqa F401, F403
``` 
also, for the tab error, we use a noqa, do a `grep "<TAB>" *.rst` to see other cases
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24303?src=pr&el=h1) Report
> Merging [#24303](https://codecov.io/gh/pandas-dev/pandas/pull/24303?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/41681c89df25e78d072c862feabe24ec715eed54?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #24303   +/-   ##
=======================================
  Coverage   92.28%   92.28%           
=======================================
  Files         162      162           
  Lines       51827    51827           
=======================================
  Hits        47827    47827           
  Misses       4000     4000
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <ø> (ø)` | :arrow_up: |
| #single | `43.01% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24303?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/24303?src=pr&el=footer). Last update [41681c8...7e4bc37](https://codecov.io/gh/pandas-dev/pandas/pull/24303?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24303?src=pr&el=h1) Report
> Merging [#24303](https://codecov.io/gh/pandas-dev/pandas/pull/24303?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/41681c89df25e78d072c862feabe24ec715eed54?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #24303      +/-   ##
==========================================
+ Coverage   92.28%   92.28%   +<.01%     
==========================================
  Files         162      162              
  Lines       51827    51831       +4     
==========================================
+ Hits        47827    47831       +4     
  Misses       4000     4000
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <ø> (-0.01%)` | :arrow_down: |
| #single | `43% <ø> (-0.02%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24303?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/\_test\_decorators.py](https://codecov.io/gh/pandas-dev/pandas/pull/24303/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvX3Rlc3RfZGVjb3JhdG9ycy5weQ==) | `90.54% <0%> (-2.71%)` | :arrow_down: |
| [pandas/core/indexes/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24303/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9wZXJpb2QucHk=) | `93.06% <0%> (ø)` | :arrow_up: |
| [pandas/core/indexes/accessors.py](https://codecov.io/gh/pandas-dev/pandas/pull/24303/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9hY2Nlc3NvcnMucHk=) | `91.08% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/24303/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `96.44% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24303/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `98.5% <0%> (+0.01%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24303/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.58% <0%> (+0.09%)` | :arrow_up: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/24303/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.82% <0%> (+0.14%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24303?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/24303?src=pr&el=footer). Last update [41681c8...a17fa1b](https://codecov.io/gh/pandas-dev/pandas/pull/24303?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@saurav2608 @datapythonista Thanks for the reviews!
some comments. ping on green.
thanks