#Python 自带的list
print('==========python自带的list集合===========')
list1 = list(range(20))
print(list1)
list2 = list1[1:10:2]#从开始下标1开始截取,下标到10结束 间隔2个
print(list2)
#从1取到尾间隔两个
list2 = list1[1::2]
print(list2)
print('========numpy=======')
import numpy as np
#一维数组
arr1 = np.array(range(20))
print(arr1)
#取13579--与Python自带的list一样
#切片
print(arr1[1:10:2])
#倒序
arr2 = arr1[::-1]
print(arr2)
#二维数组
arr3 = np.array([range(1,6),range(6,11),range(11,16)])
print(arr3)
#取用 先行后列
print(arr3[0][1])
print(arr3[0,1])
#横向截取
print(arr3[0][1:4])
print(arr3[0,1:4])
#纵向截取
print(arr3[::2])
#横纵24 79 12 14
print(arr3[::,1::2])
print('===============')
'''
1 3
6 8
11 13
'''
print(arr3[::,0:3:2])
'''
1 5
6 10
11 15
'''
print(arr3[::,0::4])
'''
2
7
12
'''
print(arr3[::,1:2])
'''
4 3 2
9 8 7
14 13 12
'''
print(arr3[::,3:0:-1])
'''
4 14
2 12
'''
print(arr3[::2,1:5:2].T[::-1])
print(arr3[::2,3:0:-2].T)