<Python, pandas> インデックスを付け直す

その1

インデックスindexを付け直すresetする方法。

df.reset_index(drop=True)

Stackoverflow

stackoverflow.com

マニュアル

Indexing and Selecting Data — pandas 0.18.0 documentation

pandas.DataFrame.reset_index — pandas 0.18.0 documentation

その2 (16/3/17 追加)

マルチインデックスmultiindexをカラムcolumnに置きなおす。

df.reset_index(inplace=True)

Stackoverflow

stackoverflow.com