Can you please add a link to the misson, next time you pose a question (guidelines )? This makes things easier for everybody. Thank you.
I assume you are refering to Choosing the right strata.
Choosing numbers of samples per bin: You want to do this proportionally, meaning that the size of the sample for each stratum relative to the total sample size is the same as the size of each group (bin) relative to the total number of observations in your original data.
relative_sizes = wnba['MIN'].value_counts(bins = 3, normalize = True).sort_index()
(10.994, 347.333] 0.335664
(347.333, 682.667] 0.349650
(682.667, 1018.0] 0.31468
This tells you that every group accounts for roughly 1/3 of overall observations in the data. Consequently, I would start out with drawing equal sized samples from each stratum. Say you want to have a sample with 15 observations in total, this would mean a sample size of 5 for each stratum.
For the code: If you think about this problem, as examplified in your/the DQ solution then I don’t see a lot of space for improvement. This being said, you could try to approach this differently. Instead of creating 3 separate dataframes - one for each bin - you could create a variable, which indicates the bin/group membership of every observation using
wnba['Min Cat'] = pd.cut(wnba['MIN'], bins=3)
Then you could iterate over all possible groups, subset the original dataframe accordingly and draw your samples.
wnba_selection = wnba[wnba['Min Cat'] == group]
sample = wnba_selection['PTS'].sample(prop, random_state=i)
Finally, you just need to tie everything together and calculate the means - similiar to what you did in your code.
If you want to play around, ask if you need help. If you are interested in the full code, I can provide this as well.