random_array = np.random.rand(10,8)
时间: 2024-06-14 13:09:27 浏览: 133
`random_array = np.random.rand(10, 8)`会生成一个形状为(10, 8)的随机数数组,其中的元素是在[0, 1)之间均匀分布的随机数。具体代码如下[^1]:
```python
import numpy as np
random_array = np.random.rand(10, 8)
print(random_array)
```
输出结果类似于:
```
[[0.12345678 0.98765432 0.45678901 0.23456789 0.87654321 0.3456789 0.56789012 0.78901234]
[0.09876543 0.654321 0.32109876 0.54321098 0.7654321 0.98765432 0.23456789 0.87654321]
[0.90123456 0.67890123 0.3456789 0.56789012 0.78901234 0.12345678 0.98765432 0.45678901]
[0.23456789 0.87654321 0.09876543 0.654321 0.32109876 0.54321098 0.7654321 0.98765432]
[0.23456789 0.45678901 0.67890123 0.3456789 0.56789012 0.78901234 0.12345678 0.98765432]
[0.45678901 0.23456789 0.87654321 0.09876543 0.654321 0.32109876 0.54321098 0.7654321 ]
[0.98765432 0.23456789 0.45678901 0.67890123 0.3456789 0.56789012 0.78901234 0.12345678]
[0.98765432 0.45678901 0.23456789 0.87654321 0.09876543 0.654321 0.32109876 0.54321098]
[0.7654321 0.98765432 0.23456789 0.45678901 0.67890123 0.3456789 0.56789012 0.78901234]
[0.12345678 0.98765432 0.45678901 0.23456789 0.87654321 0.3456789 0.56789012 0.78901234]]
```
阅读全文