当前位置:网站首页>numpy. random. choice
numpy. random. choice
2022-06-26 05:56:00 【Wanderer001】
Reference resources numpy.random.choice - cloud + Community - Tencent cloud
numpy.random.choice(a, size=None, replace=True, p=None)
from a( Array ) Select the size( dimension ) Random number of size ,replace=True Represents repeatable extraction ,p yes a The probability of occurrence of each number in . if a Is an integer , be a The array represented is arange(a).
>>> random.choice(5)
3
>>> random.choice([0.2, 0.4])
0.2
>>> random.choice([0.2, 0.4], p=[1, 0])
0.2
>>> random.choice([0.2, 0.4], p=[0, 1])
0.4
>>> random.choice(5, 5)
array([1, 2, 4, 2, 4])
>>> random.choice(5, 5, False)
array([2, 0, 1, 4, 3])
>>> random.choice(100, (2, 3, 5), False)
array([[[43, 81, 48, 2, 8],
[33, 79, 30, 24, 83],
[ 3, 82, 97, 49, 98]],
[[32, 12, 15, 0, 96],
[19, 61, 6, 42, 60],
[ 7, 93, 20, 18, 58]]])边栏推荐
- When was the autowiredannotationbeanpostprocessor instantiated?
- 421- binary tree (226. reversed binary tree, 101. symmetric binary tree, 104. maximum depth of binary tree, 222. number of nodes of complete binary tree)
- Ribbon load balancing service call
- 工厂方法模式、抽象工厂模式
- Pytorch中自己所定义(修改)的模型加载所需部分预训练模型参数并冻结
- ES6的搭配环境
- String class learning
- numpy.frombuffer()
- FindControl的源代码
- [C language] deep analysis of data storage in memory
猜你喜欢

String class learning

Implementation of third-party wechat authorized login for applet

MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

423- binary tree (110. balanced binary tree, 257. all paths of binary tree, 100. same tree, 404. sum of left leaves)

E-commerce seeks growth breakthrough with the help of small program technology
![[C language] deep analysis of data storage in memory](/img/2e/ff0b5326d796b9436f4a10c10cfe22.png)
[C language] deep analysis of data storage in memory

家庭记账程序(第二版 加入了循环)

Using Jenkins to perform testng+selenium+jsup automated tests and generate extendreport test reports

Kolla ansible deploy openstack Yoga version

Pytorch (network model)
随机推荐
[C language] deep analysis of data storage in memory
Gram matrix
【 langage c】 stockage des données d'analyse approfondie en mémoire
花生壳内网穿透映射NPM私服问题
ZigBee learning in simple terms lesson 3 external interruption
Pre-Sale Analysis
Redis多线程与ACL
【群内问题学期汇总】初学者的部分参考问题
Pytorch (environment, tensorboard, transforms, torchvision, dataloader)
DOM文档
Win socket programming (Mengxin initial battle)
Summary of the 10th provincial Blue Bridge Cup
MySQL database-01 database overview
工厂方法模式、抽象工厂模式
On site commissioning - final method of kb4474419 for win7 x64 installation and vs2017 flash back
Overloading and overriding
Definition of Halcon hand eye calibration
DOM document
Test depends on abstraction and does not depend on concrete
Given two corresponding point sets AB, how to estimate the parameters of the specified transformation matrix R?