Data Science, Product Analytics, Ab Testing, Simulation, Deep Dives.
sample_size, effect_size): # getting sample of needed size sample_df = pop_df.sample(sample_size) # randomly assign treatment sample_df['treatment'] = sample_df.index.map( lambda x: 1 if np.random.uniform() > 0.5 else 0) # add efffect for the treatment group sample_df['predicted_value'] =