数组的修改。可以使用索引的方式进行数组数据的批量修改。
array003=array002.T
print('array003:\n', array003)
print('删除单行后的数组:\n',np.delete(array003,1,axis=0))
array003=array002.T
print('批量删除后的数组:\n',np.delete(array003,(1,3),0))
array003=array002.T
print('删除单列后的数组:\n',np.delete(array003,1,1))
array003:
[[ 1 5 9]
[ 2 6 10]
[ 3 7 11]
[ 4 8 12]]
删除单行后的数组:
[[ 1 5 9]
[ 3 7 11]
[ 4 8 12]]
批量删除后的数组:
[[ 1 5 9]
[ 3 7 11]]
删除单列后的数组:
[[ 1 9]
[ 2 10]
[ 3 11]
[ 4 12]]