select specific column from panads MultiIndex dataframe
<p>I have a MultiIndex dataframe with 200 columns, I would like to select an specific column from that. Suppose, df is some part of my dataframe:</p>

<pre><code>df=
                       a                             b
                       l       h     l       h       l       h      l    
                      cold    hot    hot    cold    cold     hot   hot
2009-01-01 01:00:00   0.1     0.9    0.4    0.29    0.15     0.6    0.3
2009-01-01 02:00:00   0.1     0.8    0.35   0.2     0.15     0.6    0.4
2009-01-01 03:00:00   0.12    0.7    0.3    0.23    0.23     0.8    0.3
2009-01-01 04:00:00   0.1     0.9    0.33   0.24    0.15     0.6    0.4
2009-01-01 05:00:00   0.17    0.9    0.41   0.23    0.18     0.75   0.4
</code></pre>

<p>I would like to select the values for this column[h,hot]. </p>

<p>My output should be:</p>

<pre><code>df['h','hot']=
                       a      b
2009-01-01 01:00:00   0.9   0.6
2009-01-01 02:00:00   0.8   0.6
2009-01-01 03:00:00   0.7   0.8
2009-01-01 04:00:00   0.9   0.6
2009-01-01 05:00:00   0.9   0.75
</code></pre>

<p>I do appreciate that if someone guide me how can I select that. </p>

<p>Thank you in advance.</p>

<p>Try this:</p>

<pre><code>dataframe= pd.DataFrame()
dataframe["temp"] = df["b"]["h"]["hot"]
</code></pre>

<p>df - is your dataframe</p>

python pandas