BUG: GH #12223, GH #15262. Allow ints for names in MultiIndex
State: closed

 - [X] closes #12223 and #15262
 - [X] tests added / passed
  - `pandas/tests/frame/test_combine_concat.py::TestDataFrameConcatCommon::test_concat_numerical_names`
 - [X] passes ``git diff upstream/master | flake8 --diff``
 - [X] whatsnew entry

See discussion in #10461 .  Now if we internally know we need to call `get_level_values` for a specific level number, there is an internal function for doing that, which should allow better support for when people create indices with names that are integers.

Labels:
name: Bug
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: MultiIndex

Comments:
did u mean to close?
this looks pretty reasonable 
@jreback yes.  The conflicts indicated you had made a change that was incompatible with what I did, so I need to fix that.  Will create a new pull request when ready.
@Dr-Irv you don't need to close a PR to fix that though. simply rebase and force push. you *never* need to open a new PR for the same exact issue.
@jreback OK, didn't know that.  Should I reopen this one when I'm ready?
sure
see more detail here: http://pandas.pydata.org/pandas-docs/stable/contributing.html#contributing-your-changes-to-pandas
@Dr-Irv Already reopened it, because if you push again while the PR is closed, you cannot reopen it anymore.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15478?src=pr&el=h1) Report
> Merging [#15478](https://codecov.io/gh/pandas-dev/pandas/pull/15478?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b94186d4c58ee055656a84f55618be537db0095a?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `88.23%`.


```diff
@@            Coverage Diff             @@
##           master   #15478      +/-   ##
==========================================
+ Coverage   90.36%   90.36%   +<.01%     
==========================================
  Files         135      135              
  Lines       49519    49522       +3     
==========================================
+ Hits        44747    44750       +3     
  Misses       4772     4772
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15478?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/sql.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL2lvL3NxbC5weQ==) | `94.79% <ø> (ø)` | :white_check_mark: |
| [pandas/util/doctools.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvZG9jdG9vbHMucHk=) | `0% <ø> (ø)` | :white_check_mark: |
| [pandas/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL2luZGV4ZXMvYmFzZS5weQ==) | `96.24% <100%> (ø)` | :white_check_mark: |
| [pandas/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL2luZGV4ZXMvbXVsdGkucHk=) | `96.65% <100%> (ø)` | :white_check_mark: |
| [pandas/core/groupby.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS5weQ==) | `94.98% <100%> (ø)` | :white_check_mark: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.83% <100%> (ø)` | :white_check_mark: |
| [pandas/core/reshape.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS5weQ==) | `99.25% <100%> (ø)` | :white_check_mark: |
| [pandas/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?src=pr&el=tree#diff-cGFuZGFzL2Zvcm1hdHMvZm9ybWF0LnB5) | `95.31% <100%> (ø)` | :white_check_mark: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15478?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/15478?src=pr&el=footer). Last update [b94186d...15d8433](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...15d843307a23c169f4f34eb3ca1fa52c036354bc?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
@jreback the last commit I did should have addressed the changes you requested, and we're all green, so let me know if there is more to do

thanks @Dr-Irv 
@Dr-Irv Thanks!