DOC: Fix flake8 problems in io.rst
State: closed

- [x] closes #23791
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Pushing this code to check if this clears CI. Made a few changes towards issue #23791 

Labels:
name: Docs
name: Code Style
description: Code style, linting, code_checks

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23855?src=pr&el=h1) Report
> Merging [#23855](https://codecov.io/gh/pandas-dev/pandas/pull/23855?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b45eb265dd88648fb02ebb0fdcfb168364ab664e?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/23855/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23855?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #23855   +/-   ##
=======================================
  Coverage   42.46%   42.46%           
=======================================
  Files         161      161           
  Lines       51557    51557           
=======================================
  Hits        21892    21892           
  Misses      29665    29665
```

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


------

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

@saurav2608 in general try to not open the pull requests until you're done. You can push to your remote branch, but if you open a PR, someone will review it, and it's a waste of time if your changes are not finished (unless you need a review to make sure what you're doing is correct...)
> @saurav2608 in general try to not open the pull requests until you're done.

@datapythonista -  I will keep this in mind henceforth. I will edit the .rst file over the weekend. 


@saurav2608 do you have time to address the comments?
I got swamped by some other work. I can take this up on Wednesday. 
HI @datapythonista - travis fails with the below error. 

> [create env]
Solving environment: ...working... failed
>ResolvePackageNotFound: 
>  - flake8-rst=0.4.2

I believe you have fixed this in #23975 . Is there a way to re-initiate the test? 
can you rebase
> can you rebase

@jreback : Unfortunately, I am not able to. I messed up at some point and now rebase and squash generates conflict errors that I am not resolve it with my knowledge of git. 

I am open to ideas on how to squash the commits. In the worst case, I can delete the branch and start again. 
just do a `git fetch upstream && git merge upstream/master` edit the file with the conflict, keep the lines that arr ok, and leave the file how it has to be, do a `git add` of the file, commit and push
I am not sure if this worked. 
> I am not sure if this worked.

It did not. Somehow an old version of the file was pushed. 
Can you take a look at the first section of: https://datapythonista.github.io/blog/useful-git-commands.html
@datapythonista - I followed your post. But if I try to push I get below error. Should I pull one before pushing? 
`  ! [rejected]            io-doc -> io-doc (non-fast-forward)
error: failed to push some refs to 'https://github.com/saurav2608/pandas.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.`
> @datapythonista - I followed your post. But if I try to push I get below error. Should I pull one before pushing?
> ` ! [rejected] io-doc -> io-doc (non-fast-forward) error: failed to push some refs to 'https://github.com/saurav2608/pandas.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.`

This is done I think. I forced a push on my forked repo. 
@saurav2608 can you do in this PR branch: `git fetch upstream && git merge upstream/master && git push` please

I'm not sure why the CI is failing, I think it shouldn't, but hopefully updating the branch will fix it.
Hello @saurav2608! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`asv_bench/benchmarks/categoricals.py`](https://github.com/saurav2608/pandas/blob/aaa6b77144c1fe1ce5794527befeaf1b9d6cc149/asv_bench/benchmarks/categoricals.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/categorical.py`](https://github.com/saurav2608/pandas/blob/aaa6b77144c1fe1ce5794527befeaf1b9d6cc149/pandas/core/arrays/categorical.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/category.py`](https://github.com/saurav2608/pandas/blob/aaa6b77144c1fe1ce5794527befeaf1b9d6cc149/pandas/core/indexes/category.py) !

 - There are no PEP8 issues in the file [`pandas/core/reshape/tile.py`](https://github.com/saurav2608/pandas/blob/aaa6b77144c1fe1ce5794527befeaf1b9d6cc149/pandas/core/reshape/tile.py) !

 - There are no PEP8 issues in the file [`pandas/tests/reshape/test_tile.py`](https://github.com/saurav2608/pandas/blob/aaa6b77144c1fe1ce5794527befeaf1b9d6cc149/pandas/tests/reshape/test_tile.py) !

 - There are no PEP8 issues in the file [`pandas/tests/util/test_hashing.py`](https://github.com/saurav2608/pandas/blob/aaa6b77144c1fe1ce5794527befeaf1b9d6cc149/pandas/tests/util/test_hashing.py) !


@saurav2608 looks like the PR contains unrelated changes again. Not sure what is causing this, I don't think the command I wrote causes it. But in any case, can you repeat what you did before to fix the history and leave only your changes in the PR please.
I redid the PR. this look okay now. Please review once and let me know. 
@datapythonista  - no problem. It took long for me to fix this. Thank for your guidance. There are still some issues to resolve. For example suppressing `E402 module level import not at top of file` type errors where the import is deliberately kept at that location. I can work on those once these changes are merged. 
No worries @saurav2608, we all do what we can, and it also takes time for us to review.

I don't think we want to fix the `E402`, but make `flake8-rst` not report them as errors. I think it's better for users to have the imports in the block where they are used.

And don't worry much if not everything is fixed. There are so many things to fix at this point, that any fixes are very useful. Once most of the stuff is fixed, then we'll check more in detail the outstanding problems.

If you're looking for other things to contribute, it's probably better to wait until #23847 is merged to work on the rest of the `.rst` files, as it's a bit difficult to follow right now what is done, what's in progress, and what needs to be done. After that PR is merged, I'll create issues for the pages that need fixes, and it'll be easier.

One related issue that can be address and would be very useful to have implemented soon would be #23952.
@saurav2608 can you rebase and remove io.rst from the setup.cfg
@jreback if you want to merge this, I'll open a PR with the fixed files, and I'll add this one too.
thanks @saurav2608 

@datapythonista go for it
Opened #24051, will ping you when is green.