我正在尝试根据另一列中的值填写。请查看下面的脚本,让我知道如何避免最后一行覆盖之前的语句。非常感谢您的提前帮助!
data_xls['New'] = np.where(data_xls['Old'].str.contains('(?:ps1)', regex=True), "Promoted Story", "" )
data_xls['New'] = np.where(data_xls['Old'].str.contains('(?:native)', regex=True), "Native","" )
data_xls['New'] = np.where(data_xls['Old'].str.contains('(?:email)', regex=True), "Email", "" )
data_xls['New'] = np.where(data_xls['Old'].str.contains('(?:email)', regex=True), "InMail","" )
data_xls['New'] = np.where(data_xls['Old'].str.contains('(?:sponsored)', regex=True), "Sponsored Content","")
谢谢你, 泰