pandas.DataFrameの行名・列名の変更 note.nkmk.me
print(df.rename(columns={'A': 'Col_1', 'C': 'Col_3'}))
# Col_1 B Col_3
# ONE 11 12 13
# TWO 21 22 23
# THREE 31 32 33
pandas.DataFrameの行名・列名の変更 note.nkmk.me
print(df.rename(columns={'A': 'Col_1', 'C': 'Col_3'}))
# Col_1 B Col_3
# ONE 11 12 13
# TWO 21 22 23
# THREE 31 32 33
このページの著者: takanotume24
This version of the page was edited by Anonymous at . View the most recent version.