np.split(ary, indices_or_sections, axis=0)函数功能:把一个数组从左到右按顺序切分参数:ary:要切分的数组indices_or_sections:如果是一个整数...为沿轴切分的位置axis:沿着哪个维度进行切向,默认为0,横向切分先来看一下一维数组的情况import numpy as npx = np.array([0,1,2,3,4,5,6,7,8])print (np.split...(x,3))print (np.split(x,[3,5,6,9]))print(np.split(x,[3,5,6,8]))输出:[array([0, 1, 2]), array([3, 4, 5])...二维数组与一位数组情况基本相同import numpy as npa = np.array([[1,2,3], [1,2,5], [4,6,7]])print (np.split(a,...[2, 3],axis = 0))print (np.split(a, [1, 2],axis = 1))输出:[array([[1, 2, 3], [1, 2, 5]]), array([