pandas 拼接两列string类型数据为新的一列 df.str.cat()
需求
将两列string类型的数据拼接为新的一列;
原始数据如下:
解决
借助于 pandas.DataFrame.field.str.cat()
df['deliveryPrice'].str.cat(df['deliveryMonth']).str.upper()
将两列string类型的数据拼接为新的一列;
原始数据如下:
借助于 pandas.DataFrame.field.str.cat()
df['deliveryPrice'].str.cat(df['deliveryMonth']).str.upper()