data = pd.DataFrame(np.arange(6).reshape((2, 3)), index=pd.Index(['Ohio', 'Colorado'], name='state'), columns=pd.Index(['one', 'two', 'three'], name='number')) data numberonetwothree state Ohio012 Colorado345 result = data.stack() result state number Ohio one 0 two 1 three 2 Colorado one 3 two 4 three 5 dtype: int32 result.unstack() numberonetwothree state Ohio012 Colorado345 여기까지는 지금까지 공부한 내용으로..