You can use map and zip / join by column level:
In [11]: df
Out[11]:
a b
c d e f
1 . . . .
2 . . . .
3 . . . .
4 . . . .
In [12]: df.columns.map(lambda x: "".join(*zip(*x)))
Out[12]: array(['ac', 'ad', 'be', 'bf'], dtype=object)
In [13]: df.columns = df.columns.map(lambda x: "".join(*zip(*x)))
In [14]: df
Out[14]:
ac ad be bf
1 . . . .
2 . . . .
3 . . . .
4 . . . .
source
share