DOC: Fix format of basics.rst, following PEP-8 standard
State: closed

- [x] closes #23792 
- [x] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

I updated the format of `doc/source/basics.rst` file. 
I do not see any errors when I run `flake8-rst doc/source/basics.rst`.

Please let me know if there are some changes.

Labels:
name: Docs

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

```diff
@@            Coverage Diff             @@
##           master   #23802      +/-   ##
==========================================
+ Coverage   92.28%   92.29%   +<.01%     
==========================================
  Files         161      161              
  Lines       51451    51490      +39     
==========================================
+ Hits        47483    47521      +38     
- Misses       3968     3969       +1
```

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

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23802?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `89.18% <0%> (-0.08%)` | :arrow_down: |
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.55% <0%> (-0.02%)` | :arrow_down: |
| [pandas/core/arrays/integer.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2ludGVnZXIucHk=) | `95.47% <0%> (-0.02%)` | :arrow_down: |
| [pandas/tseries/frequencies.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvZnJlcXVlbmNpZXMucHk=) | `97.06% <0%> (-0.02%)` | :arrow_down: |
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `96.98% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `98.44% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/util/hashing.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdXRpbC9oYXNoaW5nLnB5) | `98.4% <0%> (ø)` | :arrow_up: |
| [pandas/core/sparse/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3Nlcmllcy5weQ==) | `95.53% <0%> (ø)` | :arrow_up: |
| [pandas/core/internals/blocks.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL2Jsb2Nrcy5weQ==) | `93.67% <0%> (ø)` | :arrow_up: |
| [pandas/tseries/holiday.py](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvaG9saWRheS5weQ==) | `93.17% <0%> (ø)` | :arrow_up: |
| ... and [28 more](https://codecov.io/gh/pandas-dev/pandas/pull/23802/diff?src=pr&el=tree-more) | |

------

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

I removed the spaces, and it shows these errors :
```
doc/source/basics.rst:310:10: E225 missing whitespace around operator
doc/source/basics.rst:6:4: E902 TokenError: EOF in multi-line statement
doc/source/basics.rst:754:4: E402 module level import not at top of file
doc/source/basics.rst:984:4: E402 module level import not at top of file
doc/source/basics.rst:1120:4: E402 module level import not at top of file
doc/source/basics.rst:1992:5: E999 SyntaxError: invalid syntax
```

Did I fix something wrong?
I can't see why you get these errors, but don't worry about them, we can merge all the fixes you made, and check later whether they are caused by a bug in flake-rst or what's wrong.
I fixed the missing spaces, adjusted indentation, and removed 'In [0]' from ipython.

I also fixed other errors occurred after changes. When I run `flake8-rst doc/source/basics.rst`, I see only these errors :
```
doc/source/basics.rst:753:4: E402 module level import not at top of file
doc/source/basics.rst:983:4: E402 module level import not at top of file
doc/source/basics.rst:1119:4: E402 module level import not at top of file
doc/source/basics.rst:2128:6: E402 module level import not at top of file
doc/source/basics.rst:2158:6: E402 module level import not at top of file
doc/source/basics.rst:2178:5: E402 module level import not at top of file
doc/source/basics.rst:2193:5: E402 module level import not at top of file
doc/source/basics.rst:2219:5: E402 module level import not at top of file
```
That's cool, thanks @ywpark1. I think the `E402 module level import not at top of file` shouldn't be reported by `flake8-rst`.

I'd add it to the list of flake8-rst errors to ignore in `setup.cfg`.

@FHaase what do you think?
Hi @datapythonista ,
If you do not mind, can I try to re-open this Pull Request with the same changes? I touched something wrong in the local git and now it shows bunch of weird commits showing on this Pull Request.
> If you do not mind, can I try to re-open this Pull Request with the same changes? I touched something wrong in the local git and now it shows bunch of weird commits showing on this Pull Request.

@ywpark1 The diff looks fine now? Or is there still something wrong with it? (and don't worry if there are more commits, they will get squashed when merging, so it is the diff that is important)
@ywpark1 not sure what happened exactly, but in general you don't want to modify anything in a PR once it's been approved (unless you get further feedback).

There is something that will cause some trouble in this case. When working in an issue, you should create a new local git branch. Because you worked directly in master, now you can't work in any other issue until this PR is merged. If you work in something else, you'll have to do it in master and you'll mix things, or you'll have to create a new branch from a modified master, which will contain changes unrelated to the new feature.

We could fix that with a reset, and opening a new PR, but I think it's better to try to merge this, and then you can start again.

@jorisvandenbossche as `Panel` is deprecated and soon removed, wouldn't make sense to remove that whole block about it from the pandas basics documentation? Besides giving the error, I don't think anyone reading that page should find anything about `Panel`, they'll learn things that will be removed very soon.
> @jorisvandenbossche as Panel is deprecated and soon removed, wouldn't make sense to remove that whole block about it from the pandas basics documentation? Besides giving the error, I don't think anyone reading that page should find anything about Panel, they'll learn things that will be removed very soon.

yes could remove that whole block is ok.
@ywpark1 can you remove the whole `Applying with a Panel` section please.

You can check it here if that makes things easier: http://pandas.pydata.org/pandas-docs/stable/basics.html#applying-with-a-panel
Thanks for your advice @datapythonista . I was working with local master branch by mistake.
I will try to work on other issues once this is merged.
Yes, good idea to just remove that section.

There is still another problem caused by removing this section (an import is missing in another file), but I will merge this and fix that in a separate PR.
@ywpark1 Thanks a lot!
> There is still another problem caused by removing this section (an import is missing in another file), but I will merge this and fix that in a separate PR.

https://github.com/pandas-dev/pandas/pull/23841