Fixing melt() when col_level>0 in a multi-index column
State: closed

Example Input DataFrame -
```
import pandas as pd
x = pd.DataFrame([[0, 1], [2, 3]], columns=[list('AB'), list('CD')])
"""
   A  B
   C  D
0  0  1
1  2  3
"""
x.melt(col_level=1, id_vars=['C'], value_vars=['D'])
```

Current Output -
```
KeyError: 'C'
```

Desired Output -
```
   C variable  value
0  0        D      1
1  2        D      3
```

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: MultiIndex

Comments:
Hello @rbavishi! Thanks for updating the PR.



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

##### Comment last updated on April 10, 2018 at 05:37 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20646?src=pr&el=h1) Report
> Merging [#20646](https://codecov.io/gh/pandas-dev/pandas/pull/20646?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e8f206d8192b409bc39da1ba1b2c5bcd8b65cc9f?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #20646      +/-   ##
==========================================
+ Coverage   91.83%   91.84%   +<.01%     
==========================================
  Files         153      153              
  Lines       49269    49271       +2     
==========================================
+ Hits        45247    45251       +4     
+ Misses       4022     4020       -2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.22% <100%> (ø)` | :arrow_up: |
| #single | `41.9% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20646?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/melt.py](https://codecov.io/gh/pandas-dev/pandas/pull/20646/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZWx0LnB5) | `97.39% <100%> (+0.04%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/20646/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `84.59% <0%> (+0.2%)` | :arrow_up: |

------

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

@rbavishi : Thanks for submitting this!  A couple of things:

1) Before submitting a PR, you should generally submit an issue.  The content of your PR message would have been perfect for that!

2) You'll need to add tests and an entry into our `whatsnew` file for `0.23.0`
closing as stale