I have a dataframe. I would like to test whether, (C), on each row, the number in column (B) is in the string, column (A).
df = pd.DataFrame({\'A\': [\"me 12
Values NaNs are floats, so you can convert output to floats:
NaN
float
df['C'] = df.A.str.extract('(\d+)', expand=False).astype(float).eq(df.B,0).astype(int)