diff --git a/test/2024,09,29/test3.py b/test/2024,09,29/test3.py new file mode 100644 index 0000000..12a387a --- /dev/null +++ b/test/2024,09,29/test3.py @@ -0,0 +1,8 @@ +# 练习题3: 切片和索引操作 +# 题目: 有一个NumPy数组 a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) , +# 请使用切片和索引操作获取数组的第二行第三列的元素。 + +import numpy as np + +a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) +print(a[1, 2])