Skip to content

Instantly share code, notes, and snippets.

@jmmshn
Last active November 5, 2020 04:24
Show Gist options
  • Save jmmshn/a24f78506189416e1569cb8708e67aa9 to your computer and use it in GitHub Desktop.
Save jmmshn/a24f78506189416e1569cb8708e67aa9 to your computer and use it in GitHub Desktop.
Generate a uniue set of random samples of different sizes
from collections import defaultdict
import random
insert_idx = defaultdict(set)
ll = range(6)
for n in range(1, 7):
for i in range(20):
sites = random.sample(ll, n)
insert_idx[n].add(frozenset(sites))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment