pandas 拼接两列string类型数据为新的一列 df.str.cat()

需求

将两列string类型的数据拼接为新的一列;

原始数据如下:

 解决

借助于 pandas.DataFrame.field.str.cat()

df['deliveryPrice'].str.cat(df['deliveryMonth']).str.upper()

 

posted @ 2021-04-15 10:15  ZhuGaochao  阅读(1186)  评论(0编辑  收藏  举报