不重复采样
c = range(10) N = 30 index1 = random.sample(c, N) index2 = random.sample(c, N) print(index1) print(index2)
可重复采样:
import numpy as np choices = np.random.choice(c, size=30, replace=True) print(choices)
欢迎分享,转载请注明来源:内存溢出
不重复采样
c = range(10) N = 30 index1 = random.sample(c, N) index2 = random.sample(c, N) print(index1) print(index2)
可重复采样:
import numpy as np choices = np.random.choice(c, size=30, replace=True) print(choices)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)