代码
import numpy as np
arr1 = np.arange(10)
print(arr1)
print( arr1[5] )
print( arr1[5:8] )
arr1[5:8] = 10
print(arr1)
print('-------------------------------')
#副本(改变数组的值,但是不改变原来的数组)
arr_slice = arr1[5:8].copy() #为新数组赋值
arr_slice[:] = 2
print(arr1)
print(arr_slice)