From d4a68cb2cd254bc6a2c9ef7e392c2c696dfdd7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=9D=82=E6=98=B4?= Date: Mon, 30 Sep 2024 20:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=83=E4=B9=A0=E9=A2=98=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/2024,09,29/test3.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/2024,09,29/test3.py 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])