DOC: Improve reshape\concat
State: closed

- [x] closes #46825
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Labels:
name: Docs

Comments:
Hello @anetakahle! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2022-05-27 10:26:04 UTC
@MarcoGorelli thanks for a quick review :)
I've updated the example, is the current version better?
> I've also read the discussion about the deprecated append and maybe we should add some note into the documentation as well, something like

Yes, good suggestion, thanks!
@MarcoGorelli fixed, shows only 1 file changed now as intended
@MarcoGorelli I also ran the pre-commit locally and it didn't fail. 

But there are still some other fails here on GitHub, but some of them are on the document as a whole, not just my changes (for example in the case of ```Code Checks / Docstring and typing validation (pull_request)``` the test shows to some errors which are not in the code I posted)
are you sure you committed your latest changes? can you show the output of:
```
pre-commit run --files pandas/core/reshape/concat.py
git remote -v
git fetch origin
git diff origin/doc-concat
```
please?
@MarcoGorelli 
Sure!

**Here is the output:**
[**pre-commit run --files pandas/core/reshape/concat.py**](https://pastebin.com/DkNKRYPU)
[**git remote -v**](https://pastebin.com/n7xSBfMN)
**git fetch origin** - no output
[**git diff origin/doc-concat**](https://pastebin.pl/view/3aa7e718)

OK looks like you have lots of local unstaged changes (perhaps from a merge gone not quite right?)

I think the simplest way out would be:
```
git checkout -- .  # discard local changes
git reset --hard origin/doc-concat
pre-commit run --files pandas/core/reshape/concat.py
git commit -m 'lint file'
git push origin doc-concat
```
@MarcoGorelli 
Oh, I am so sorry I accidentally ran it from the `main` branch, not the `doc-concat` branch so that was the reason why it came out so weird.
Now I already linted and commited the changes properly.
@MarcoGorelli 
The extra level on indentation was added by the pre-commit. 
But I think I fixed it. 😄 
@MarcoGorelli 
Resolved. :)
@MarcoGorelli 
OMG, the pre-commit has done so much mess in there :D 
I fixed it, I hope it's all ok and I can squash now? :)
@MarcoGorelli 
Ok, I think I fixed it, 
but the `Code Checks / Docstring and typing validation` test is still failing and I don't know why :/ :D
Maybe because of some code I didn't add?
```
FAILED pandas/core/tools/datetimes.py::pandas.core.tools.datetimes.to_datetime
...
=================================== FAILURES ===================================
______________ [doctest] pandas.core.tools.datetimes.to_datetime _______________
1013 
1014     >>> pd.to_datetime(['2018-10-26 12:00 -0530', '2018-10-26 12:00 -0500'],
1015     ...                utc=True)
1016     DatetimeIndex(['2018-10-26 17:30:00+00:00', '2018-10-26 17:00:00+00:00'],
1017                   dtype='datetime64[ns, UTC]', freq=None)
1018 
1019     - Inputs can contain both naive and aware, string or datetime, the above
1020       rules still apply
1021 
1022     >>> pd.to_datetime(['2018-10-26 12:00', '2018-10-26 12:00 -0530',
UNEXPECTED EXCEPTION: NameError("name 'timezone' is not defined")
Traceback (most recent call last):
  File "/usr/share/miniconda/envs/pandas-dev/lib/python3.8/doctest.py", line [133](https://github.com/pandas-dev/pandas/runs/6543790014?check_suite_focus=true#step:10:134)6, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest pandas.core.tools.datetimes.to_datetime[18]>", line 4, in <module>
NameError: name 'timezone' is not defined
/home/runner/work/pandas/pandas/pandas/core/tools/datetimes.py:1022: UnexpectedException
```
@MarcoGorelli 
Thank you😁💜☺️
Congratulations! :wink: 
@MarcoGorelli
Oh, I didn't notice. 
I changed it. 

Thank you :)
thanks @anetakahle