I have the following loop in Python:
df[\'count\'] = \'\' for i in range(len(df)): if df[\'A\'].iloc[i] == df[\'B\