当前位置:网站首页>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]]])边栏推荐
猜你喜欢

DOM document

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

uniCloud云开发获取小程序用户openid
转帖——不要迷失在技术的海洋中

Pytorch (network model training)

Kolla ansible deploy openstack Yoga version

原型模式,咩咩乱叫

【C語言】深度剖析數據在內存中的存儲

类和对象的学习

There are applications related to web network request API in MATLAB (under update)
随机推荐
numpy.log
numpy.frombuffer()
04. basic data type - list, tuple
How to use the tablet as the second extended screen of the PC
Test depends on abstraction and does not depend on concrete
one billion two hundred and twelve million three hundred and twelve thousand three hundred and twenty-one
Describe an experiment of Kali ARP in LAN
Detailed explanation of serial port communication principle 232, 422, 485
Consul服务注册与发现
Source code of findcontrol
numpy.random.choice
What management systems (Updates) for things like this
E-commerce seeks growth breakthrough with the help of small program technology
Day3 - variables and operators
自定义WebSerivce作为代理解决SilverLight跨域调用WebService问题
工厂方法模式、抽象工厂模式
How to associate wechat applet QR code to realize two code aggregation
Pre-Sale Analysis
转帖——不要迷失在技术的海洋中
Machine learning 05: nonlinear support vector machines