Pretium Interview Question

python dataframe weighted average, some probability with finance background setup