edit line if string end with pandas code example Example: edit line if str end with pandas df.loc[df.stime.str.endswith('+2'), 'edate'] = pts['sdate']+1