练习题第五题

This commit is contained in:
2024-09-30 20:56:18 +08:00
parent dd76477b0c
commit 57cc77c7a4
+8
View File
@@ -0,0 +1,8 @@
# 练习题5: 修改数组形状(
# 题目: 有一个一维NumPy数组 a = np.arange(6) ,请将其重塑为形状为(2, 3)的二维数组。
import numpy as np
a = np.arange(6)
a = a.reshape(2, 3)
print(a)