将下列的array 转换成一个2x5的2维数组 (10 points) # arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
时间: 2023-07-02 13:22:29 浏览: 169
好的,以下是代码实现:
```python
import numpy as np
arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
arr_2d = arr.reshape(2, 5)
print(arr_2d)
```
输出:
```
[[0 1 2 3 4]
[5 6 7 8 9]]
```
阅读全文