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

不重复采样

复制代码
1
2
3
4
5
6
7
8
c = range(10) N = 30 index1 = random.sample(c, N) index2 = random.sample(c, N) print(index1) print(index2)

可重复采样:

复制代码
1
2
3
4
import numpy as np choices = np.random.choice(c, size=30, replace=True) print(choices)

最后

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

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

评论列表共有 0 条评论

立即
投稿
返回
顶部