2.27

import numpy as np
a = np.arange(16).reshape(4,4)
b = a[1][2]
c= a[1, 2]
d = a[1:2, 2:3]
x = np.array([0, 1, 2, 1])
print(a[x == 1])

posted @ 2024-10-27 23:27  世梦  阅读(15)  评论(0)    收藏  举报