diff --git a/test/2024,09,29/test5.py b/test/2024,09,29/test5.py new file mode 100644 index 0000000..6449ff5 --- /dev/null +++ b/test/2024,09,29/test5.py @@ -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)