Files
2024-09-30 20:50:34 +08:00

9 lines
281 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 练习题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])