how to compute a new column based on the values of other columns in pandas - python,df['c'] = (df.a.str[-1] == df.b).astype(int)