I noticed that you have used the following command to identify NULL, which is not wrong.
df['ab_test_group'] = df.fitness_test_date.apply(lambda x: 'B' if x == None else 'A')
I would like you to be aware of the following alternative methods :
df['ab_test_group'] = df.fitness_test_date.apply(lambda x: 'A' if pd.notnull(x) else 'B')
df['ab_test_group'] = df.fitness_test_date.apply(lambda x: 'B' if pd.isnull(x) else 'A')
I noticed that you have used the following command to identify NULL, which is not wrong. df['ab_test_group'] = df.fitness_test_date.apply(lambda x: 'B' if x == None else 'A')
I would like you to be aware of the following alternative methods : df['ab_test_group'] = df.fitness_test_date.apply(lambda x: 'A' if pd.notnull(x) else 'B')
df['ab_test_group'] = df.fitness_test_date.apply(lambda x: 'B' if pd.isnull(x) else 'A')