我是靠谱客的博主 优雅雨,这篇文章主要介绍python 重复采样,不重复采样,现在分享给大家,希望可以做个参考。

不重复采样

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)

最后

以上就是优雅雨最近收集整理的关于python 重复采样,不重复采样的全部内容,更多相关python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(117)

评论列表共有 0 条评论

立即
投稿
返回
顶部