pydata/pandas — pull request #4150 by hayd (2013-07-06 17:08:19+00:00)
Title: Melt multi

No idea if there's actually a market for this, but anyhow:

```
In [1]: df = pd.DataFrame([[ 1.067683, -1.110463, 0.20867 ], [-1.321405, 0.368915, -1.055342], [-0.807333, 0.08298 , -0.873361]])

In [2]: df.columns = [list('ABC'), list('abc')]

In [3]: df.columns.names = ['CAP', 'low']

In [4]: df
Out[4]:
CAP A B C
low a b c
0 1.067683 -1.110463 0.208670
1 -1.321405 0.368915 -1.055342
2 -0.807333 0.082980 -0.873361

In [5]: pd.melt(df, col_level=0)
Out[5]:
CAP value
0 A 1.067683
1 A -1.321405
2 A -0.807333
3 B -1.110463
4 B 0.368915
5 B 0.082980
6 C 0.208670
7 C -1.055342
8 C -0.873361

In [6]: pd.melt(df,)
Out[6]:
CAP low value
0 A a 1.067683
1 A a -1.321405
2 A a -0.807333
3 B b -1.110463
4 B b 0.368915
5 B b 0.082980
6 C c 0.208670
7 C c -1.055342
8 C c -0.873361

In [7]: df.columns.names = [None, None]

In [8]: pd.melt(df,)
Out[8]:
variable_0 variable_1 value
0 A a 1.067683
1 A a -1.321405
2 A a -0.807333
3 B b -1.110463
4 B b 0.368915
5 B b 0.082980
6 C c 0.208670
7 C c -1.055342
8 C c -0.873361
```

Also includes fix for `get_level_values` and name attribute.