You can use np.random.choice with replace=False as follows: np.random.choice(vec, size, replace=False, p=P) where vec is your population and P is the weight ...
確定! 回上一頁