You're looking for .reset_index()
.
In [11]: df = pd.DataFrame([[2, 3], [5, 6]], pd.Index([1, 4], name="A"), columns=["B", "C"])
In [12]: df
Out[12]:
B C
A
1 2 3
4 5 6
In [13]: df.reset_index()
Out[13]:
A B C
0 1 2 3
1 4 5 6
Note: That you can avoid this step by using as_index=False
when doing the groupby.
step1 = step3.groupby(['Id', 'interestingtabsplittest2__grp'], as_index=False)['applications'].sum()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…