私の個人的な好み(アルファベット順または数値順ではなく、特定の規則に従う方が良い)に基づいて、pandasデータフレームの列を並べ替える方法はありますか?pandasデータフレームの列の順序を設定する
簡単な例:に
はone thing second thing other thing
0 1 0.1 a
1 2 0.2 e
2 3 1.0 i
3 4 2.0 o
(、汎用的なソリューションを提供してくださいではなく、具体的な:
one thing other thing second thing
0 1 a 0.1
1 2 e 0.2
2 3 i 1.0
3 4 o 2.0
しかし、その代わりに、私はこれをしたいと思います:
frame = pd.DataFrame({
'one thing':[1,2,3,4],
'second thing':[0.1,0.2,1,2],
'other thing':['a','e','i','o']})
が、これは生産しますこの場合、多くのありがとう)