数组切片

In:

#类似列表操作进行索引和切片
data3 = np.array([1,2,3,4,5])
print(data3)
print(data3[0])
print(data3[2:4])
print(data3[2:])
print(data3[:4])
Out:
[1 2 3 4 5]
1
[3 4]
[3 4 5]
[1 2 3 4]