![]() import pandas as pdĭef provide_stratified_bootstap_sample_indices(bs_sample): In turn, the randomly drawn indices can just be combined into one list (that should in the end have the same length as the original Dataframe). I chose to iterate over all relevant strata clusters in the original Dataframe, retrieve the index of the relevant rows in each stratum and randomly (with replacement) draw the same amount of samples from the stratum that this very stratum consists of. ![]() Function to create index for original Dataframe to create stratified bootstrapped sample Just had to implement this in python, I will just post my current approach here in case this is of interest for others. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |