更新时间:2023-12-06 12:54:22
df.columns = [f'{i}{j}' for i, j in df.columns]
map
和join
:
map
and join
:df.columns = df.columns.map(''.join)
map
和format
:
map
and format
:df.columns = df.columns.map('{0[0]}{0[1]}'.format)
barone bartwo bazone baztwo fooone footwo foothree
A 1 2 3 4 5 6 7
B 8 9 10 11 12 13 14