numpy.random.RandomState.bytes

方法

random.RandomState.bytes(length)

返回随机字节。

注解

新代码应该使用 bytes A方法 default_rng() 请参阅 快速启动 .

参数
length利息

随机字节数。

返回
outSTR

长度字符串 length .

参见

Generator.bytes

应该用于新代码。

实例

>>> np.random.bytes(10)
' eh\x85\x022SZ\xbf\xa4' #random