concatinate pandas dataframe to multiindex
<p>I have a pandas dataframe like this  </p>

<pre><code>df1=pd.DataFrame(np.random.randint(0,10,size=(3,3)),columns=list('ABC'))
df1.index.name="ID1"


df2=pd.DataFrame(np.random.randint(0,10,size=(3,3)),columns=list('ABC'))
df2.index.name="ID2"
</code></pre>

<p>so,How can I concatinate like below,this dataframe have multiindex.</p>

<pre><code>        A  B  C 
ID1 0   7  5  7
    1   6  3  8
    2   6  5  4
ID2 0   3  9  7
    1   8  7  5
    2   3  9  9
</code></pre>

<p>I have tried 'pd.concat([df1,df2])' but multiindex hasnt created.</p>

<p>Concat is correct</p>

<pre><code>pd.concat([df1,df2], keys=['id1', 'id2'])
</code></pre>

python pandas