BUG: coerce pd.wide_to_long suffixes to ints
State: closed

- [x] closes #17627
- [x] I had to change nearly all the tests which had the suffixes as strings to integers. I also added a few other tests including one for string suffixes
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

I also cleaned up the finding of the var_names and substituted in some list comprehensions.

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17628?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@1355df6`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #17628   +/-   ##
=========================================
  Coverage          ?   91.58%           
=========================================
  Files             ?      153           
  Lines             ?    51275           
  Branches          ?        0           
=========================================
  Hits              ?    46961           
  Misses            ?     4314           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.45% <100%> (?)` | |
| #single | `40.68% <14.28%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17628?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/melt.py](https://codecov.io/gh/pandas-dev/pandas/pull/17628/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZWx0LnB5) | `97.24% <100%> (ø)` | |

------

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

Hello @tdpetrou! Thanks for updating the PR.





Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on December 10, 2017 at 16:20 Hours UTC
can you rebase.

@TomAugspurger @jorisvandenbossche comments.
edited to add: I did the following and then squashed all the commits into 1 and change a word in the commit message

First time rebasing. I did...
```
git fetch upstream
git rebase upstream/master
```
Resolved conflicts then did 
```
git add <files>
git rebase --continue
```
Gave some message about forgetting to do `git add` which i just did. Then i did

```
git rebase --skip
git push origin wide-to-long-int -f
```

Which did something but I don't know if this is what you wanted.
it looks rebased


maybe add ``downcast=True`` (as the default), consistent with other functions that we have.
@jreback Unless there is a different `to_numeric`, there is no option for `downcast=True`. And why would you want to downcast it to something other than the default 64 bit types?
needs a rebase. this is orthogonal to #17677 ?
Yes, this is mutually exclusive. I think pd.wide_to_long can be rewritten too. Its quite slow.
ok, rebase and move whatsnew to 0.22
@jreback I attempted to revert whatsnew 0.21. Not sure if I did it correctly. I changed the names in the format as well.
this should be after #18428, you can rebase on top (of that one after you have pushed)
@jreback changes made. Should I add examples to whatsnew?
@jreback Since all the examples had integers as suffixes, I added one with strings.
@jreback 
can you rebase
@jreback Got lost in rebase hell. Will self-flagellate 10 times if I did this wrong.
@jorisvandenbossche 
Thanks!