DOC: Fixed implicit imports for whatsnew (v >= version 20.0)
State: closed

- [x] xref #24177 
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
This partially resolves #24177 .

Labels:
name: Docs
name: Clean

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

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

```diff
@@            Coverage Diff             @@
##           master   #24199      +/-   ##
==========================================
- Coverage   92.21%   92.21%   -0.01%     
==========================================
  Files         162      162              
  Lines       51723    51723              
==========================================
- Hits        47695    47694       -1     
- Misses       4028     4029       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.61% <ø> (ø)` | :arrow_up: |
| #single | `43.03% <ø> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24199?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/24199/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `92.61% <0%> (-0.48%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24199/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.51% <0%> (+0.09%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24199?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/24199?src=pr&el=footer). Last update [77278ba...bdf5ac9](https://codecov.io/gh/pandas-dev/pandas/pull/24199?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/24199?src=pr&el=h1) Report
> Merging [#24199](https://codecov.io/gh/pandas-dev/pandas/pull/24199?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/77278ba8158457f142e6bba19e6d53a66a3f1322?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #24199      +/-   ##
==========================================
- Coverage   92.21%   92.21%   -0.01%     
==========================================
  Files         162      162              
  Lines       51723    51723              
==========================================
- Hits        47695    47694       -1     
- Misses       4028     4029       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.61% <ø> (ø)` | :arrow_up: |
| #single | `43.03% <ø> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24199?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/24199/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `92.61% <0%> (-0.48%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24199/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.51% <0%> (+0.09%)` | :arrow_up: |

------

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

> Can we remove these files from the exclude in setup.cfg?

Not yet, These changes only fix the implicit import errors. 
> Do you mean in the PR title >=0.23.0

I have fixed (if required) all the implicit import `from pandas import *` for version >= 20.0. I have removed the import block for all these files. flake8 errors still exist and I have opened individual issues for each of them. 
In this PR I only see files `>=0.23` changed, that's why I find the title misleading. Do you mean that in `0.20` to `0.22` we don't have the `import *`.

Do you think it's worth to fix the `import *` separate from the rest? Happy to merge this PR, but for the rest, for me it makes things simpler to fix all the problems in a single file at once, remove it from the exclusion list, and besides in the issue, keep track in `setup.cfg` of what is correct, and what needs to be fixed.
> In this PR I only see files `>=0.23` changed, that's why I find the title misleading. Do you mean that in `0.20` to `0.22` we don't have the `import *`.

Yes, that is correct. We don't have import *
> Do you think it's worth to fix the `import *` separate from the rest? Happy to merge this PR, but for the rest, for me it makes things simpler to fix all the problems in a single file at once, remove it from the exclusion list, and besides in the issue, keep track in `setup.cfg` of what is correct, and what needs to be fixed.

Okay. But please merge this for now.  For the rest I have not created issues yet. So, I can create an overall issues for all sorts of flake8 issues. 
@datapythonista seeing gazillion warnings in the doc build: https://travis-ci.org/pandas-dev/pandas/jobs/465964000 I don't think this PR is actually causing them, but should fix this up before any more doc fixes.
Thanks for the heads up. Seems unrelated to the fixes we've been merging, but I'm taking a look now, I'll try to see what's wrong and send a fix asap.
@jreback the warnings come from #23601, where `IntervalArrayFormatter` was replaced by `ExtensionArrayFormatter`. But `IntervalIndex` is still using `IntervalArrayFormatter`.

Will check if fixing it is straight-forward, but I wouldn't let that stop merging the documentation PRs.

CC: @TomAugspurger 
> @jreback the warnings come from #23601, where IntervalArrayFormatter was replaced by ExtensionArrayFormatter. But IntervalIndex is still using IntervalArrayFormatter.


That's fixed https://github.com/pandas-dev/pandas/pull/24134
@datapythonista  - are you waiting for #24134 to be merged before merging this? 
no, we like to double check what we merge, so I approved the changes, and whenever another maintainer have time to review this PR, they'll merge it if they're happy
thanks @saurav2608 FYI don't put 'closes' in the PR header in cases like this, use xref (as github will close the referenced issue)