CHH3213 / Note-Ubuntu_CHH3213

ubuntu系统CHH3213上做的笔记
0 stars 0 forks source link

79. python 用numpy生成多维随机数组 #79

Open CHH3213 opened 2 years ago

CHH3213 commented 2 years ago

1. 产生随机的小数多维数组

import numpy as np
a=np.random.random((3,3))

print a

2. 产生多维的整数随机数组

import numpy as np

a=np.random.randint(0,10,size=[3,3])

print a