【发布时间】:2018-08-23 13:26:41
【问题描述】:
我有一个这样的DataFrame:
A B
----------
c d
e f
我想介绍第三列,由A、B 和索引的串联组成,因此DataFrame 变为:
A B C
---------------
c d cd0
e f ef1
我想这样做:
df['C'] = df['A'] + df['B'] + # and here I don't know how to reference the row index.
我该怎么做?
【问题讨论】:
标签: python string pandas dataframe concatenation