Timeline for How do I compose a list from an Association such that the final product matches a fixed percentage of each of four subsets?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 2, 2022 at 1:22 | comment | added | Rogo | Great!! I really appreciate it. I know SE frowns on superfluous commentary but it is hard to restrain myself... | |
Sep 1, 2022 at 20:53 | vote | accept | Rogo | ||
Sep 1, 2022 at 20:34 | comment | added | MarcoB |
That's actually an easy fix: use RandomSample instead of RandomChoice . I've updated my answer to reflect that and added a check for duplicates.
|
|
Sep 1, 2022 at 18:56 | comment | added | Rogo | @MarcoB - my FAULT!!! The sample is without replacement. I edited the above (BOLD). Since you got 1033 picks out of 1000 there are duplicates. Am presently combing through your code to find a solution | |
Sep 1, 2022 at 18:53 | history | edited | Rogo | CC BY-SA 4.0 |
added 21 characters in body
|
Sep 1, 2022 at 18:41 | vote | accept | Rogo | ||
Sep 1, 2022 at 18:45 | |||||
Sep 1, 2022 at 15:16 | answer | added | MarcoB | timeline score: 2 | |
Sep 1, 2022 at 2:07 | history | edited | Rogo | CC BY-SA 4.0 |
added 238 characters in body
|
Sep 1, 2022 at 0:55 | comment | added | MarcoB |
Group your list of associations by the value corresponding to the sector key, then sample from the list of lists with RandomChoice, using {0.13, 0.19, 0.28, 0.4} as weights?
|
|
Aug 31, 2022 at 22:59 | history | edited | Rogo | CC BY-SA 4.0 |
deleted 113 characters in body
|
Aug 31, 2022 at 21:28 | history | asked | Rogo | CC BY-SA 4.0 |