I have two samples of cookies. Sample 1 has 51 cookies and sample 2 has 47 cookies. They have different mass distributions, D1 and D2, and I have fit gaussians to them via python. The plot below shows the samples' mass distributions, as well as the weighted distribution which is defined as D2/D1.
I'm interested in creating a subsample of Sample 1, which takes into account the weighted distribution, to allow a more fair comparison between the two samples due to their varying masses. The Gaussians that I've fit have 1000 points in them, and thus the weighted distribution is a different size than the sample arrays.
How would one go about doing this in python?