练习题第五题
This commit is contained in:
@@ -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)
|
||||||
Reference in New Issue
Block a user